* Add polymorphism to Broadcasts table - Adds a broadcastable_id column to Broadcasts - Adds a broadcastable_type column to Broadcasts * Create Announcements and Welcome Notifications tables - Adds an Announcements table - Adds a Welcome Notifications table - Adds timestamps to both tables - Adds banner_style column to Announcements table * Adds Announcement and Welcome Notification models - Adds an Announcement model in prep for polymorphism - Adds a WelcomeNotification model in prep for polymorphism * Add data_update script to backfill type_of column for Broadcasts * Add unique index on broadcastable_type and broadcastable_id on the Broadcasts table * Add update! to the data_update script to backfill broadcastable_type
6 lines
201 B
Ruby
6 lines
201 B
Ruby
class AddPolymorphismToBroadcasts < ActiveRecord::Migration[6.0]
|
|
def change
|
|
add_column :broadcasts, :broadcastable_id, :integer
|
|
add_column :broadcasts, :broadcastable_type, :string
|
|
end
|
|
end
|