Skip to content
This repository was archived by the owner on Jan 30, 2024. It is now read-only.
This repository was 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

@ssnyder

Description

@ssnyder

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions