-
Hi,
How do I give this a default Not a const one like this: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you want the default value to be stored in the database as part of the table's definition, If you anticipate that you need to change the default value frequently, an alternative would be clientDefault. That value is filled in by drift when an insert happens and is not stored in the database itself, so you can change it without a schema migration. |
Beta Was this translation helpful? Give feedback.
If you want the default value to be stored in the database as part of the table's definition,
Constant(false)
would be the appropriate value. If you want to change the value later, you'd re-run the build and write a schema migration to change the default value as stored in the database.If you anticipate that you need to change the default value frequently, an alternative would be clientDefault. That value is filled in by drift when an insert happens and is not stored in the database itself, so you can change it without a schema migration.