Sha256: ef73ac0a3ed6b31457f422827e500691699dcc2566a0409ece03362b393dd16a
Contents?: true
Size: 744 Bytes
Versions: 6
Compression:
Stored size: 744 Bytes
Contents
# This migration comes from alchemy (originally 20160617224938) class ChangeAlchemyPagesLockedToLockedAt < ActiveRecord::Migration[4.2] def up add_column :alchemy_pages, :locked_at, :datetime update <<-SQL.strip_heredoc UPDATE alchemy_pages SET locked_at = updated_at WHERE locked=#{ActiveRecord::Base.connection.quoted_true} SQL remove_column :alchemy_pages, :locked add_index :alchemy_pages, [:locked_at, :locked_by] end def down add_column :alchemy_pages, :locked, :boolean update <<-SQL.strip_heredoc UPDATE alchemy_pages SET locked=#{ActiveRecord::Base.connection.quoted_true} WHERE locked_at IS NOT NULL SQL remove_column :alchemy_pages, :locked_at end end
Version data entries
6 entries across 6 versions & 3 rubygems