This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2017-12-06 18:37:43 -08:00
|
|
|
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
|
|
|
|
|
2021-03-18 18:42:43 -07:00
|
|
|
class AddEmbedURLToPreviewCards < ActiveRecord::Migration[5.1]
|
2017-12-06 18:37:43 -08:00
|
|
|
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
|