1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00
mastodon/db/migrate/20171130000000_add_embed_url_to_preview_cards.rb

17 lines
386 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class AddEmbedURLToPreviewCards < ActiveRecord::Migration[5.2]
2017-12-06 18:37:43 -08:00
disable_ddl_transaction!
def up
safety_assured do
add_column :preview_cards, :embed_url, :string, default: '', null: false
2017-12-06 18:37:43 -08:00
end
end
def down
execute "UPDATE preview_cards SET url=embed_url WHERE embed_url!=''"
remove_column :preview_cards, :embed_url
end
end