correct pattern for adding a column with a default value, without setting a server_default ? #1730
Unanswered
jvanasco
asked this question in
Usage Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I need to add a new
INT
column that isNOT NULL
to an existing table in sqlite. The existing records should show an initial value of1
during the migration, but the column should not have a default value when the migration is done - the default is to only be managed on the python side. I can think of a few ways to do this using consecutive batch_ops, but I wanted to know if there was a preferred way (readability? speed? another reason?)Beta Was this translation helpful? Give feedback.
All reactions