phatworx / devise_security_extension

An enterprise security extension for devise, trying to meet industrial standard security demands for web applications.
MIT License
747 stars 346 forks source link

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

Open ssnyder opened 7 years ago

ssnyder commented 7 years ago

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