Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Password_archivable DB Migration issues with MySQL error v0.8.2 #225

Open
ssnyder opened this issue Sep 19, 2017 · 0 comments
Open

Password_archivable DB Migration issues with MySQL error v0.8.2 #225

ssnyder opened this issue Sep 19, 2017 · 0 comments

Comments

@ssnyder
Copy link

ssnyder commented Sep 19, 2017

When I run my migration to create the old_passwords table, I'm getting the error:
Mysql2::Error: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead: CREATE TABLE old_passwords (id int(11) DEFAULT NULL auto_increment PRIMARY KEY, encrypted_password varchar(255) NOT NULL, password_salt varchar(255), password_archivable_type varchar(255) NOT NULL, password_archivable_id int(11) NOT NULL, created_at datetime) ENGINE=InnoDB

I've already got devise installed, and running. I am trying to add password archiving to my application. I've added the migration:
create_table :old_passwords do |t|
t.string :encrypted_password, :null => false
t.string :password_salt
t.string :password_archivable_type, :null => false
t.integer :password_archivable_id, :null => false
t.datetime :created_at
end
add_index :old_passwords, [:password_archivable_type, :password_archivable_id], :name => :index_password_archivable

and it fails with that error message. I tried downgrading to 0.7 and it had the same problem. Am I missing something?

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant