cartodb-4.42/db/migrate/20160407150453_drop_permission_entity_fields.rb
2024-04-06 05:25:13 +00:00

20 lines
470 B
Ruby

Sequel.migration do
up do
alter_table(:permissions) do
drop_column :entity_id
drop_column :entity_type
end
end
down do
alter_table(:permissions) do
add_column :entity_id, :uuid
add_column :entity_type, :text
end
SequelRails.connection.run(%{
UPDATE permissions SET entity_id = visualizations.id, entity_type = 'vis'
FROM visualizations
WHERE permissions.id = visualizations.permission_id })
end
end