Sha256: 58a439b0826cc12e2db36b15e4743d78d3427d689e1e63d226690d1d083f6a85
Contents?: true
Size: 588 Bytes
Versions: 4
Compression:
Stored size: 588 Bytes
Contents
class AddOrganizationToSccAccount < ActiveRecord::Migration class SccAccount < ActiveRecord::Base belongs_to :organization end class Organization < ActiveRecord::Base end def up Organization.table_name = 'taxonomies' add_column :scc_accounts, :organization_id, :integer, null: true, index: true SccAccount.all.each do |a| a.organization = Organization.first a.save! end change_column :scc_accounts, :organization_id, :integer, null: false, index: true end def down remove_column :scc_accounts, :organization_id, :integer end end
Version data entries
4 entries across 4 versions & 1 rubygems