Sha256: c1216bda6dbd5bb5c1a587ac37f8e0a7f81c28ec4ea2f8f0515ef8088424ab3e
Contents?: true
Size: 537 Bytes
Versions: 10
Compression:
Stored size: 537 Bytes
Contents
class AddSourcesToShopSubscriptions < ActiveRecord::Migration def change add_column :disco_app_subscriptions, :source_id, :integer, limit: 8, index: true add_foreign_key :disco_app_subscriptions, :disco_app_sources, column: :source_id DiscoApp::Subscription.where.not(source: nil).find_each do |subscription| DiscoApp::Source.find_or_create_by(source: subscription.source) do |new_source| new_source.name = subscription.source end end remove_column :disco_app_subscriptions, :source end end
Version data entries
10 entries across 10 versions & 1 rubygems