cartodb-4.42/db/migrate/20141022172959_enable_map_flags_by_default.rb

23 lines
1.1 KiB
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
Sequel.migration do
up do
SequelRails::connection.run 'ALTER TABLE organizations DROP COLUMN IF EXISTS here_maps_enabled'
SequelRails::connection.run 'ALTER TABLE organizations DROP COLUMN IF EXISTS stamen_maps_enabled'
SequelRails::connection.run 'ALTER TABLE users DROP COLUMN IF EXISTS here_maps_enabled'
SequelRails::connection.run 'ALTER TABLE users DROP COLUMN IF EXISTS stamen_maps_enabled'
add_column :organizations, :here_maps_enabled, :boolean, default: true
add_column :organizations, :stamen_maps_enabled, :boolean, default: true
add_column :users, :here_maps_enabled, :boolean, default: true
add_column :users, :stamen_maps_enabled, :boolean, default: true
end
down do
SequelRails::connection.run 'ALTER TABLE organizations DROP COLUMN IF EXISTS here_maps_enabled'
SequelRails::connection.run 'ALTER TABLE organizations DROP COLUMN IF EXISTS stamen_maps_enabled'
SequelRails::connection.run 'ALTER TABLE users DROP COLUMN IF EXISTS here_maps_enabled'
SequelRails::connection.run 'ALTER TABLE users DROP COLUMN IF EXISTS stamen_maps_enabled'
end
end