0
0
Fork 0

Add embed_url to preview cards (#5775)

This commit is contained in:
Akihiko Odaki 2017-12-07 11:37:43 +09:00 committed by Eugen Rochko
parent 432761f375
commit c083816c24
7 changed files with 38 additions and 9 deletions

View file

@ -0,0 +1,18 @@
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
class AddEmbedUrlToPreviewCards < ActiveRecord::Migration[5.1]
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