cartodb-4.29/db/migrate/20161202171602_drop_visualizations_state_id.rb

21 lines
513 B
Ruby
Raw Permalink Normal View History

2020-06-15 10:58:47 +08:00
require 'carto/db/migration_helper'
include Carto::Db::MigrationHelper
migration(
Proc.new do
drop_column :visualizations, :state_id
end,
Proc.new do
alter_table :visualizations do
add_foreign_key :state_id, :states, type: 'uuid', null: true
end
# The following code should be executed to restore the index for state_id
# SequelRails.connection.run %{
# CREATE INDEX CONCURRENTLY "visualizations_state_id_index"
# ON "visualizations" ("state_id");
# }
end
)