Db forge |
Hi sorry for english , i have two answer about db forge :
Code: function create_users_table(){ The first , i have this error : Error Number: 1067 Invalid default value for 'data_registrazione' CREATE TABLE `users_codeigniter` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `email` VARCHAR(100) NOT NULL UNIQUE, `username` VARCHAR(50) NULL DEFAULT NULL, `password_hash` VARCHAR(255) NOT NULL, `activation_hash` VARCHAR(255) NULL DEFAULT NULL, `password_reset_hash` VARCHAR(255) NULL DEFAULT NULL, `data_registrazione` timestamp(6) NOT NULL DEFAULT 'CURRENT_TIMESTAMP', `id_ruolo` INT(11) NOT NULL DEFAULT 1, `id_stato` INT(11) NOT NULL DEFAULT 1, `last_login` DATETIME NULL DEFAULT NULL, CONSTRAINT `pk_users_codeigniter` PRIMARY KEY(`id`) ) DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci Filename: models/User_model.php Line Number: 481 The second , how can i add a foreign key?
"Invalid default value for 'data_registrazione'"
Base on error you have issue on the following line data_registrazione' => array( 'type' =>'timestamp', 'constraint' => '6', 'default' => CURRENT_TIMESTAMP CURRENT_TIMESTAMP is = "1970-01-01 00:00:01" for example and cannot put in field that has 6 constraint.
There are those who tell lies with meaning behind them and those meaning less lies!
|
Welcome Guest, Not a member yet? Register Sign In |