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
{{ message }}
This repository has been archived by the owner on May 13, 2022. It is now read-only.
I am iteratively developing a script to add foreign key constraints throughout a postgres database. In some cases the usual concatenation of table and column names to construct constraint and index names produces names that exceed the permitted length, so in those cases I am providing my own names. E.g.,
This works fine the first time through. However, if I re-run the migration, schema_plus wants to first make an attempt to drop the constraint if, but it does that without reference to the name I've provided, resulting in an error:
NOTICE: identifier "fk_staffing_plan_category_item_pairings_staffing_plan_category_id" will be truncated to "fk_staffing_plan_category_item_pairings_staffing_plan_category_"
rake aborted!
PG::UndefinedObject: ERROR: constraint "fk_staffing_plan_category_item_pairings_staffing_plan_category_" of relation "staffing_plan_category_item_pairings" does not exist
: ALTER TABLE "staffing_plan_category_item_pairings" DROP CONSTRAINT fk_staffing_plan_category_item_pairings_staffing_plan_category_id
I am able to work around the problem by manually deleting the constraints and indexes in question.
The text was updated successfully, but these errors were encountered:
I am iteratively developing a script to add foreign key constraints throughout a postgres database. In some cases the usual concatenation of table and column names to construct constraint and index names produces names that exceed the permitted length, so in those cases I am providing my own names. E.g.,
This works fine the first time through. However, if I re-run the migration, schema_plus wants to first make an attempt to drop the constraint if, but it does that without reference to the name I've provided, resulting in an error:
I am able to work around the problem by manually deleting the constraints and indexes in question.
The text was updated successfully, but these errors were encountered: