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

Version Path
alchemy-devise-4.2.0 spec/dummy/db/migrate/20160627081901_change_alchemy_pages_locked_to_locked_at.alchemy.rb
alchemy-devise-4.1.0 spec/dummy/db/migrate/20160627081901_change_alchemy_pages_locked_to_locked_at.alchemy.rb
alchemy-solidus-2.2.0 spec/dummy/db/migrate/20180910094592_change_alchemy_pages_locked_to_locked_at.alchemy.rb
alchemy-devise-4.1.0.beta spec/dummy/db/migrate/20160627081901_change_alchemy_pages_locked_to_locked_at.alchemy.rb
alchemy_kono_mailup-0.0.1 spec/dummy/db/migrate/20171124145470_change_alchemy_pages_locked_to_locked_at.alchemy.rb
alchemy-devise-4.0.0 spec/dummy/db/migrate/20160627081901_change_alchemy_pages_locked_to_locked_at.alchemy.rb