Working out outdated migrations

Several migrations were failing when running db:migrate at the initial release version from an empty database.
These changes took out statements that were causing migrations to fail, usually because of references to models that no longer exist.
This commit is contained in:
Chris Schetter
2013-02-05 13:23:06 -08:00
parent 31c5859bbe
commit 32ff6c264a
7 changed files with 366 additions and 215 deletions

View File

@@ -1,9 +1,5 @@
class MigrateBookmarksToPostActions < ActiveRecord::Migration
def up
execute "insert into post_actions(user_id, post_action_type_id, post_id, created_at, updated_at)
select distinct b.user_id, #{PostActionType.bookmark.id} , p.id, b.created_at, b.updated_at
from bookmarks b
join posts p on p.forum_thread_id = b.forum_thread_id and p.post_number = b.post_number"
drop_table "bookmarks"
end