AlchemyCMS / alchemy_cms

Alchemy is the Open Source Rails CMS framework for the component based web that can be used as classic server side rendered or headless CMS.
https://www.alchemy-cms.com
BSD 3-Clause "New" or "Revised" License
846 stars 315 forks source link

install w existing project - migrate => Table 'users' already exists: #293

Closed ghost closed 12 years ago

ghost commented 12 years ago

I surely have missed something, but upon running

rake db:migrate the migration starts.. then failed when dealing with the existing users table

== CreateUsers: migrating ==================================================== -- create_table(:users) rake aborted! An error has occurred, all later migrations canceled:

Mysql2::Error: Table 'users' already exists:

what's wrong with this ? should I delete manually the create_users.alchemy.rb file ? sorry , I guess I should post this issue in the google group ...

tvdeyen commented 12 years ago

Alchemy has its own namespaced users table named alchemy_users.

The problem is that the old migrations add the users table at first. Later it will be renamed into the new namespaced one.

We should compact the old migrations. But we have to find a way to be downwards compatible, so that old projects can be migrated as well. Spree does this very well.

ghost commented 12 years ago

I understand .. will check that

tvdeyen commented 12 years ago

I pushed to the current master branch that should fix this issue. Please try it out and report any feedback.

Remove all Alchemy migrations from your db/migrate folder and update your Gemfile

# Gemfile
gem 'alchemy_cms', :github => 'magiclabs/alchemy_cms'

Update your bundle

bundle update

Rerun the migrations

rake db:migrate

Thanks