Sha256: 71f5b8353a8e01f00c5e93b801ce6d8fbf14b3f593bdd51e8b6588daf03fdec0
Contents?: true
Size: 544 Bytes
Versions: 33
Compression:
Stored size: 544 Bytes
Contents
class ChangeStatusValuesForComments < ActiveRecord::Migration STATUS_CHANGES = { 30 => 70, 35 => 65, 40 => 60, } def self.up change_column :comments, :status, :integer, :default => 70, :null => false STATUS_CHANGES.each do |from, to| execute "UPDATE comments SET status = #{to} WHERE status = #{from}" end end def self.down change_column :versions, :status, :integer STATUS_CHANGES.each do |from, to| execute "UPDATE comments SET status = #{from} WHERE status = #{to}" end end end
Version data entries
33 entries across 33 versions & 1 rubygems