You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cartodb/db/migrate/20150915141325_change_synch...

26 lines
891 B

Sequel.migration do
up do
# INFO: Careful, order matters!
SequelRails.connection.run(%{
ALTER TABLE data_imports ALTER COLUMN synchronization_id TYPE uuid USING synchronization_id ::uuid;
})
SequelRails.connection.run(%{
ALTER TABLE external_data_imports DROP CONSTRAINT synchronization_id_fkey;
})
SequelRails.connection.run(%{
ALTER TABLE external_data_imports ALTER COLUMN synchronization_id TYPE uuid USING synchronization_id ::uuid;
})
SequelRails.connection.run(%{
ALTER TABLE synchronizations ALTER COLUMN id TYPE uuid USING id ::uuid;
})
SequelRails.connection.run(%{
ALTER TABLE external_data_imports
ADD CONSTRAINT synchronization_id_fkey FOREIGN KEY (synchronization_id)
REFERENCES synchronizations (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE CASCADE;
})
end
down do
end
end