Sha256: a2df1c3a78bbcd9cc27dc0a6dc4c9b68759e739bfb621d24e12ba6dc0bcbd67c

Contents?: true

Size: 1001 Bytes

Versions: 7

Compression:

Stored size: 1001 Bytes

Contents

class NotificationSettingsMigration < ActiveRecord::Migration<%= migration_version %>
    def change
        add_column :notifications, :subscription_id, :bigint, index: true
        add_column :notifications, :category, :string, index: true

        create_table :notification_settings_settings do |t|

            t.references :object, polymorphic: true, index: { name: 'idx_settings_object_type_object_id' }
            t.references :subscription, index: true

            t.string :status

            t.text :settings
            t.text :category_settings

            t.timestamps

        end

        create_table :notification_settings_subscriptions do |t|

            t.references :subscriber, polymorphic: true, index: { name: 'idx_subscriptions_subscriber_type_subscriber_id' }
            t.references :subscribable, polymorphic: true, index: { name: 'idx_subscriptions_subscribable_type_subscribable_id' }

            t.timestamps

        end
    end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
notification-settings-1.2.5 lib/generators/templates/install/notifications_migration.rb.erb
notification-settings-1.2.4 lib/generators/templates/install/notifications_migration.rb.erb
notification-settings-1.2.3 lib/generators/templates/install/notifications_migration.rb.erb
notification-settings-1.2.2 lib/generators/templates/install/notifications_migration.rb.erb
notification-settings-1.2.1 lib/generators/templates/install/notifications_migration.rb.erb
notification-settings-1.2.0 lib/generators/templates/install/notifications_migration.rb.erb
notification-settings-1.1.2 lib/generators/templates/install/notifications_migration.rb.erb