-
Notifications
You must be signed in to change notification settings - Fork 23
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
chore: migrate internal and keysend columns to be non null #442
base: main
Are you sure you want to change the base?
Conversation
26c69ac
to
afaf6fd
Compare
I think we would need to set a default? or how does the value now get filled? |
Internal bool `json:"-" bun:",nullzero"` | ||
Keysend bool `json:"keysend" bun:",nullzero"` | ||
Internal bool `json:"-" bun:",notnull,default:false"` | ||
Keysend bool `json:"keysend" bun:",notnull,default:false"` |
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.
they still use nullzero:
https://bun.uptrace.dev/guide/models.html#default
nullzero,notnull,default:false
?
I think if ""
(blank) is set then bun converts it to NULL
which then uses the default of false
.
ALTER COLUMN keysend SET DEFAULT false; | ||
|
||
ALTER TABLE invoices | ||
ALTER COLUMN keysend SET NOT NULL; |
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.
if a default is set, do we then still need a NOT NULL
constraint?
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.
Yes because I've seen the db values go from false to NULL while running integration_tests for some reason
Fixes #417