You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The intention of add_columns_fk is only add not check if it must be added, for that exists get_foreign_keys which should be called in the script to check if foreign_key must be created or not
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
The text was updated successfully, but these errors were encountered: