Sha256: 516693640edc4b65627fe4c1189a1db5a60e14cc83d2dcee4157256bde9e070c
Contents?: true
Size: 839 Bytes
Versions: 40
Compression:
Stored size: 839 Bytes
Contents
class MoveCnameFromAccountToTheming < ActiveRecord::Migration def up add_column :pageflow_themings, :cname, :string, null: false, default: '' add_index :pageflow_themings, :cname execute("UPDATE pageflow_themings SET cname = (SELECT cname FROM pageflow_accounts WHERE pageflow_accounts.default_theming_id = pageflow_themings.id LIMIT 1);") remove_index :pageflow_accounts, :cname remove_column :pageflow_accounts, :cname end def down add_column :pageflow_accounts, :cname, :string, null: false, default: '' add_index :pageflow_accounts, :cname execute("UPDATE pageflow_accounts SET cname = (SELECT cname FROM pageflow_themings WHERE pageflow_themings.id = pageflow_accounts.default_theming_id);") remove_index :pageflow_themings, :cname remove_column :pageflow_themings, :cname end end
Version data entries
40 entries across 40 versions & 1 rubygems