2
0
mirror of https://github.com/moebooru/moebooru synced 2025-08-22 01:47:48 +00:00
moebooru/db/migrate/081_disable_change_seq_cache.rb
2018-03-10 18:15:56 +09:00

12 lines
352 B
Ruby

class DisableChangeSeqCache < ActiveRecord::Migration[5.1]
def self.up
execute "ALTER SEQUENCE post_change_seq CACHE 1"
execute "ALTER TABLE posts ALTER COLUMN change_seq DROP NOT NULL"
end
def self.down
execute "ALTER SEQUENCE post_change_seq CACHE 10"
execute "ALTER TABLE posts ALTER COLUMN change_seq SET NOT NULL"
end
end