Separa i canali app e mostra il nodo ingest nelle sessioni admin. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
1.0 KiB
Ruby
27 lines
1.0 KiB
Ruby
class SplitAnnouncementAppPlatforms < ActiveRecord::Migration[7.2]
|
|
def change
|
|
add_column :app_announcements, :show_on_android, :boolean, null: false, default: true
|
|
add_column :app_announcements, :show_on_ios, :boolean, null: false, default: true
|
|
add_column :app_announcements, :android_title, :string
|
|
add_column :app_announcements, :android_body, :text
|
|
add_column :app_announcements, :android_action_url, :string
|
|
add_column :app_announcements, :android_action_label, :string
|
|
add_column :app_announcements, :ios_title, :string
|
|
add_column :app_announcements, :ios_body, :text
|
|
add_column :app_announcements, :ios_action_url, :string
|
|
add_column :app_announcements, :ios_action_label, :string
|
|
|
|
reversible do |dir|
|
|
dir.up do
|
|
execute <<~SQL.squish
|
|
UPDATE app_announcements
|
|
SET show_on_android = show_on_app,
|
|
show_on_ios = show_on_app
|
|
SQL
|
|
end
|
|
end
|
|
|
|
remove_column :app_announcements, :show_on_app, :boolean, null: false, default: true
|
|
end
|
|
end
|