-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add NOT NULL constraints to repository #978
Conversation
return err | ||
} | ||
|
||
if err := sess.Sync2(new(RepoV17)); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had assumed that calling Sync2(..)
would add the new NOT NULL
constraints to the table, but it doesn't seem to be working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. It will not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what should I do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you have to write SQL yourself.
This will be more annoying than I had initially thought, since SQLite and TiDB don't support adding constraints to existing columns. I'll put this on hold for now. |
#962
I'm having trouble with my migration; right now, it does not actually add
NOT NULL
constraints to the existing columns of therepository
table. If someone who knows what they're doing could point me in the right direction, I would appreciate it! 😄I've tested locally using Postgres 9.5.5