Welcome! Here you can paste sources and general debugging text, You can even set yourself a password if you want to keep it just for yourself.

Posted by sql on December Mon 16th 3:21 PM - Never Expires - Views: 656

  1. CREATE  TABLE IF NOT EXISTS `xxx`.`logs` (
  2.   `idlogs` INT(11) NOT NULL AUTO_INCREMENT ,
  3.   `cod_pais` INT(11) ZEROFILL NOT NULL ,
  4.   `cod_estado` SMALLINT(6) ZEROFILL NOT NULL ,
  5.   `cod_cidade` INT(11) ZEROFILL NOT NULL ,
  6.   `idradios` INT(11) ZEROFILL NOT NULL ,
  7.   `date` TIMESTAMP NOT NULL ,
  8.   `ip` VARCHAR(45) NOT NULL ,
  9.   PRIMARY KEY (`idlogs`) )
  10. ENGINE = InnoDB
  11. DEFAULT CHARACTER SET = utf8
  12. COLLATE = utf8_general_ci;
  13.  
  14. ALTER TABLE `logs`
  15.   ADD CONSTRAINT `fk_cod_pais_logs` FOREIGN KEY (`cod_pais`) REFERENCES `pais` (`cod_pais`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  16.   ADD CONSTRAINT `fk_cod_estado_logs` FOREIGN KEY (`cod_estado`) REFERENCES `estado` (`cod_estado`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  17.   ADD CONSTRAINT `fk_cod_cidade_logs` FOREIGN KEY (`cod_cidade`) REFERENCES `cidade` (`cod_cidade`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  18.   ADD CONSTRAINT `fk_idradios_logs` FOREIGN KEY (`idradios`) REFERENCES `radios` (`idradios`) ON DELETE NO ACTION ON UPDATE NO ACTION;
Language:
To highlight particular lines, prefix each line with @@




© 2017  YSblue.com.br (Implemented and Adapted) - Powered by PASTE 1.0