I have had ongoing trouble migrating a database in rails via rake db:migrate.
My migration currently looks like this:
class CreateArticles < ActiveRecord::Migration
def change
create_table :articles do |t|
t.string :title
t.text :subtitle
t.string :slug
t.text :body
t.integer :publish, limit: 1, default: 0
t.timestamps
end
end
end
However if ever I delete a column from this or even add or modify one the rake db:migrate command does nothing. The only way I can migrate it is sometimes running something like:
rake db:migrate VERSION=20080906120000
But even that is temperamental so most of the time I need to reset the db using
db:drop
db:create
then running the migration again as normal. basically db:migrate only ever works the first time after dropping and creating the db.
I've also tried rollback before running the migration.
This is far from ideal so I'd appreciate any help.
(I realise there are similar questions but all of their issues are solved after a db reset)