You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to initialise the database we get (formatted)
Mysql2::Error: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead:
CREATE TABLE `users` (
`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY,
`username` varchar(255) DEFAULT '' NOT NULL,
`email` varchar(255) DEFAULT '' NOT NULL,
`encrypted_password` varchar(255) DEFAULT '' NOT NULL,
`reset_password_token` varchar(255),
`reset_password_sent_at` datetime,
`remember_created_at` datetime,
`sign_in_count` int(11) DEFAULT 0,
`current_sign_in_at` datetime,
`last_sign_in_at` datetime,
`current_sign_in_ip` varchar(255),
`last_sign_in_ip` varchar(255),
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL) ENGINE=InnoDB
/usr/lib/ruby/gems/1.9.1/gems/mysql2-0.3.21/lib/mysql2/client.rb:85:in `_query'
/usr/lib/ruby/gems/1.9.1/gems/mysql2-0.3.21/lib/mysql2/client.rb:85:in `query'
The problem is 5.7 no longer supporting null values for the primary key.
A unique index where all key columns must be defined as NOT NULL. If they are not explicitly declared as NOT NULL, MySQL declares them so implicitly (and silently). A table can have only one PRIMARY KEY.
The text was updated successfully, but these errors were encountered:
When trying to initialise the database we get (formatted)
The problem is 5.7 no longer supporting null values for the primary key.
https://dev.mysql.com/doc/refman/5.7/en/create-table.html#create-table-indexes-keys
The text was updated successfully, but these errors were encountered: