sorcery icon indicating copy to clipboard operation
sorcery copied to clipboard

0.7.4 Migration Creation Order

Open johnbeynon opened this issue 15 years ago • 1 comments

The Core migration is created with a later index than any of the modules - surely it should be created first so it exists when then subsequent change tables are run

johnbeynon avatar Oct 30 '11 10:10 johnbeynon

+1. I've reproduced this with Rails 3.1.1 + latest sorcery from github, doing, e.g.:

$ rails generate sorcery:install remember_me reset_password
...
create  db/migrate/20111103194703_sorcery_remember_me.rb
create  db/migrate/20111103194704_sorcery_reset_password.rb
create  db/migrate/20111103194705_sorcery_core.rb

Note the timestamp order.

Then, running rake db:migrate, I get:

==  SorceryRememberMe: migrating ==============================================
-- add_column(:users, :remember_me_token, :string, {:default=>nil})
rake aborted!
An error has occurred, this and all later migrations canceled:

SQLite3::SQLException: no such table: users: ALTER TABLE "users" ADD "remember_me_token" varchar(255) DEFAULT NULL

Tasks: TOP => db:migrate
(See full trace by running task with --trace)

I'm going to take a stab at fixing this.

corockliff avatar Nov 03 '11 19:11 corockliff