If we are trying to create a fk constraint and it exists, fails.
We can put a constraint existence test like:
select constraint_name from information_schema.constraint_column_usage where table_name = [t_name] and constraint_name = [c_name]
or drop and create:
ALTER TABLE [t_name] DROP CONSTRAINT IF EXISTS [c_name]
in https://github.com/gisce/oopgrade/blob/661689373ae565a68f0d5400307a383b244d1109/oopgrade/oopgrade.py#L297C28-L297C29
@ecarreras @polsala
If we are trying to create a fk constraint and it exists, fails.
We can put a constraint existence test like:
select constraint_name from information_schema.constraint_column_usage where table_name = [t_name] and constraint_name = [c_name]or drop and create:
ALTER TABLE [t_name] DROP CONSTRAINT IF EXISTS [c_name]in https://github.com/gisce/oopgrade/blob/661689373ae565a68f0d5400307a383b244d1109/oopgrade/oopgrade.py#L297C28-L297C29
@ecarreras @polsala