Files
danbooru/db/migrate/20130331182719_add_pixiv_id_to_posts.rb
r888888888 6caa0f0436 fix tests
2013-04-14 22:24:55 -07:00

14 lines
395 B
Ruby

class AddPixivIdToPosts < ActiveRecord::Migration
def up
execute "set statement_timeout = 0"
add_column :posts, :pixiv_id, :integer
execute "drop index index_posts_on_pixiv_id"
execute "create index index_posts_on_pixiv_id on posts (pixiv_id) where pixiv_id is not null"
end
def down
execute "set statement_timeout = 0"
remove_column :posts, :pixiv_id
end
end