Custom column type with default not working?
I tried to add a new column with a custom type and a default value.
but for some reason when I tried to
db push
, it warned me that it didn't have a default value and that it would truncate the tables.
Am I doing something wrong?
3 Replies
I decided to say Yes to the warning to see what happens. The drizzle-kit truncated the table, but the table seems to have the correct
default
value.
Now if I add some data and run db push
again (without doing any changes), it thinks the data is serial
and it wants to truncate it again.
Found the GitHub issue on this.
https://github.com/drizzle-team/drizzle-orm/issues/818
Sorry that I didn't search there first..
GitHub
[BUG]: Column with custom type not working with
default()
· Issue...What version of drizzle-orm are you using? v0.27.0 What version of drizzle-kit are you using? v0.19.2 Describe the Bug With the following schema: import { customType, mysqlTable, serial, varchar } ...
I think the root issue is that drizzle doesn't support unsigned ints. I'm guessing you wouldn't be creating custom types if unsigned ints were supported