Sha256: ee55c7942ea61bc66f974775d19947ec519d304131f04d71870343ddd3e03a4e
Contents?: true
Size: 707 Bytes
Versions: 47
Compression:
Stored size: 707 Bytes
Contents
class ModifySiteIdForSpudPages < ActiveRecord::Migration def up change_column :spud_pages,:site_id,:integer,:default => 0,:null => false change_column :spud_templates,:site_id,:integer,:default => 0,:null => false change_column :spud_menus,:site_id,:integer,:default => 0,:null => false SpudPage.where(:site_id => nil).each {|f| f.site_id = 0 ; f.save} SpudMenu.where(:site_id => nil).each {|f| f.site_id = 0 ; f.save} end def down change_column :spud_pages,:site_id,:integer,:default => nil,:null => true change_column :spud_templates,:site_id,:integer,:default => nil,:null => true change_column :spud_menus,:site_id,:integer,:default => nil,:null => true end end
Version data entries
47 entries across 47 versions & 2 rubygems