* 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
7 lines
216 B
Ruby
7 lines
216 B
Ruby
class AddIndexToBroadcasts < ActiveRecord::Migration[6.0]
|
|
disable_ddl_transaction!
|
|
|
|
def change
|
|
add_index :broadcasts, %i[broadcastable_type broadcastable_id], unique: true, algorithm: :concurrently
|
|
end
|
|
end
|