mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-11 13:10:37 +00:00
a4dcaef53b
* Prepare Mastodon for zeitwerk autoloader (Rails 6) Add inflections and rename/move a few classes. In particular, app/lib/exceptions.rb and app/lib/sanitize_config.rb were manually loaded while still in autoload paths. * Add inflection for Url → URL
19 lines
477 B
Ruby
19 lines
477 B
Ruby
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
|