diff options
author | David Yip <yipdw@member.fsf.org> | 2017-12-06 22:34:42 -0600 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2017-12-06 22:34:42 -0600 |
commit | ddb61deccefeda2346e64002528764841bcb7315 (patch) | |
tree | 0ee86119b8260661d85e5e41a1342c30802f620b /db/migrate/20171130000000_add_embed_url_to_preview_cards.rb | |
parent | 935c1944e27be4df9ba821a0f38fd599d1877a31 (diff) | |
parent | 744447b3c04d7806e383f0d1ad7a10c73bd667ef (diff) |
Merge remote-tracking branch 'personal/merge/tootsuite/master' into gs-master
Diffstat (limited to 'db/migrate/20171130000000_add_embed_url_to_preview_cards.rb')
-rw-r--r-- | db/migrate/20171130000000_add_embed_url_to_preview_cards.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20171130000000_add_embed_url_to_preview_cards.rb b/db/migrate/20171130000000_add_embed_url_to_preview_cards.rb new file mode 100644 index 000000000..d19c0091b --- /dev/null +++ b/db/migrate/20171130000000_add_embed_url_to_preview_cards.rb @@ -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 |