You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
477 B
19 lines
477 B
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
|
|
|
|
class AddEmbedURLToPreviewCards < ActiveRecord::Migration[5.2]
|
|
include Mastodon::MigrationHelpers
|
|
|
|
disable_ddl_transaction!
|
|
|
|
def up
|
|
safety_assured do
|
|
add_column_with_default :preview_cards, :embed_url, :string, default: '', allow_null: false
|
|
end
|
|
end
|
|
|
|
def down
|
|
execute "UPDATE preview_cards SET url=embed_url WHERE embed_url!=''"
|
|
remove_column :preview_cards, :embed_url
|
|
end
|
|
end
|