cartodb/db/migrate/20190521171900_add_visualization_id_assets.rb
2020-06-15 10:58:47 +08:00

23 lines
462 B
Ruby

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
)