2023-07-12 09:47:08 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-03-27 16:09:10 +02:00
|
|
|
class AddEmbedURLToPreviewCards < ActiveRecord::Migration[5.2]
|
2017-12-07 03:37:43 +01:00
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
|
|
|
safety_assured do
|
2024-01-10 11:35:06 +01:00
|
|
|
add_column :preview_cards, :embed_url, :string, default: '', null: false
|
2017-12-07 03:37:43 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
execute "UPDATE preview_cards SET url=embed_url WHERE embed_url!=''"
|
|
|
|
remove_column :preview_cards, :embed_url
|
|
|
|
end
|
|
|
|
end
|