Constraints are not added to migration replay files. #5

Closed
opened 2017-01-27 01:42:31 +00:00 by jamie · 5 comments
jamie commented 2017-01-27 01:42:31 +00:00 (Migrated from git.hazaar.io)

This is a weird one. Not sure why this is happening but needs some testing.

I had an existing table on which I wanted to add a unique constraint on a column. I did this, then did the snapshot and it appeared to work. The schema.json file was written correctly and a new schema was created successfully from that. However the migration replay file had only a up/create/index entry (no "down" entry at all) and it was missing the "name" and "table" attributes meaning it would cause an error on replay.

This is a weird one. Not sure why this is happening but needs some testing. I had an existing table on which I wanted to add a unique constraint on a column. I did this, then did the snapshot and it appeared to work. The schema.json file was written correctly and a new schema was created successfully from that. However the migration replay file had only a up/create/index entry (no "down" entry at all) and it was missing the "name" and "table" attributes meaning it would cause an error on replay.
jamie commented 2017-01-27 01:43:14 +00:00 (Migrated from git.hazaar.io)

added ~152 label

added ~152 label
jamie commented 2017-01-27 01:43:57 +00:00 (Migrated from git.hazaar.io)

added ~153 label

added ~153 label
jamie commented 2017-01-27 10:41:06 +00:00 (Migrated from git.hazaar.io)

This issue was not entirely accurate. The constraints we were looking for were ONLY foreign keys. The constraint I could not get added to the migration file was a UNIQUE constraint. I have re-worked a lot of the constraint processing because of issue #4 which has helped fix this issue.

This issue was not entirely accurate. The constraints we were looking for were ONLY foreign keys. The constraint I could not get added to the migration file was a UNIQUE constraint. I have re-worked a lot of the constraint processing because of issue #4 which has helped fix this issue.
jamie commented 2017-01-27 10:41:06 +00:00 (Migrated from git.hazaar.io)

Added 1h of time spent on this issue

Added 1h of time spent on this issue
jamie commented 2017-01-27 11:21:12 +00:00 (Migrated from git.hazaar.io)

This is a major update and will require some changes to existing schema files. Primary keys are now always listed in the constraints, not in the table descriptions.

This is a major update and will require some changes to existing schema files. Primary keys are now always listed in the constraints, not in the table descriptions.
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#5
No description provided.