cartodb-4.42/db/migrate/20190521171900_add_visualization_id_assets.rb

23 lines
462 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
require 'carto/db/migration_helper'
include Carto::Db::MigrationHelper
migration(
Proc.new do
alter_table :assets do
add_foreign_key :visualization_id,
:visualizations,
type: :uuid,
on_delete: :cascade
add_index [:visualization_id]
end
end,
Proc.new do
alter_table :assets do
drop_index :visualization_id
drop_column :visualization_id
end
end
)