Commit 3793c094 authored by Rémy Coutable's avatar Rémy Coutable

Make db/post_migrate/20161128170531_drop_user_activities_table.rb rollbackable

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 3f5d5001
...@@ -17,7 +17,18 @@ class DropUserActivitiesTable < ActiveRecord::Migration ...@@ -17,7 +17,18 @@ class DropUserActivitiesTable < ActiveRecord::Migration
# comments: # comments:
# disable_ddl_transaction! # disable_ddl_transaction!
def change def up
drop_table :user_activities drop_table :user_activities if table_exists?(:user_activities)
end
def down
unless table_exists?(:user_activities)
create_table "user_activities", force: :cascade do |t|
t.integer "user_id"
t.datetime "last_activity_at", null: false
end
add_index "user_activities", ["user_id"], name: "index_user_activities_on_user_id", unique: true, using: :btree
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment