Closed robinboening closed 10 years ago
Yes, we should definitely remove the user table creation and removal migrations from alchemy core (alchemy_cms).
The alchemy-devise gem then should only create the alchemy_users table if the table does not already exist. A second migration in the alchemy-devise gem then needs to add the necessary roles columns to the alchemy_users table.
That should do the trick.
I just upgraded an existing app running with alchemy 2.7 to rails4 and alchemy 3.0.
Running the migrations (i.e. from the upgrader) the
alchemy_users
table is being dropped. That means we loose all our user data.Considering this migration will also run on a production server, we loose all the users there.
I spent some time of thinking on this issue and I think I came to a good solution.
It would be better to remove the
alchemy_users
table creation from the merged migration. Additionally to remove the migration that drops thealchemy_users
table. On alchemy-devise side we just have to upgrade the roles column if the table exists and we have a legacy-column.That changes mean we will let an existing
alchemy_users
table untouched, but we would never create a new one. This is important to support all three ways of using Alchemy 3.0:alchemy_users
table created.alchemy_users
table and its important that it still exists.alchemy_users
table created.I have prepared the mentioned changes, but its not 100% completed yet and needs some love. I will send a Pull request tonight or tomorrow.