cartodb-4.42/db/migrate/20161025084350_create_layer_node_style.rb

21 lines
577 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
create_table :layer_node_styles do
primary_key :id, type: :uuid, default: Sequel.lit('uuid_generate_v4()')
foreign_key :layer_id, :layers, type: :uuid, null: false, on_delete: :cascade
String :source_id, null: false
json :options, null: false
json :infowindow, null: false
json :tooltip, null: false
unique [:layer_id, :source_id]
end
end,
Proc.new do
drop_table :layer_node_styles
end
)