DB migration fails due to PK and FK order #10

Closed
opened 2017-02-04 06:54:37 +00:00 by jamie · 2 comments
jamie commented 2017-02-04 06:54:37 +00:00 (Migrated from git.hazaar.io)

We do all the constraints at the same time now. Previously we used to do primary keys when creating the table, which meant by the time we did foreign keys we were OK.

Now though, if we try to create a foreign key on a table that has not yet had it's primary key defined, it fails.

I think the easiest/best solution here would be to do two passes. One for primary keys, the next for all other constraints.

We do all the constraints at the same time now. Previously we used to do primary keys when creating the table, which meant by the time we did foreign keys we were OK. Now though, if we try to create a foreign key on a table that has not yet had it's primary key defined, it fails. I think the easiest/best solution here would be to do two passes. One for primary keys, the next for all other constraints.
jamie commented 2017-02-04 08:04:40 +00:00 (Migrated from git.hazaar.io)

Completed

Completed
jamie commented 2017-02-04 08:04:41 +00:00 (Migrated from git.hazaar.io)

closed

closed
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/hazaar-dbi#10
No description provided.