Open jschuur opened 8 months ago
Thank you for reparting @jschuur. @gris Could you have a look at this please?
With this config it seams to work
createdAt: integer('created_at', { mode: 'timestamp_ms' }).default(sql
(unixepoch())),
updatedAt: integer('updated_at', { mode: 'timestamp_ms' }).default(sql
(unixepoch())),
The issue is on Studio visualization
I'm also getting unixepoch() as value in the database column. Any update on this matter?
Looks like your Drizzle Studio version has problems executing default SQL when adding rows. Not sure where else to file this :)
Using Drizzle, I have a schema that looks (in part) like this:
This creates the following migration:
Now if i visit https://turso.tech/app/databases and add a new record and leave the date fields blank, this creates an entry that lists
(cast (unixepoch() as int))
and not an epoch timestamp as expected:Likewise, in the turso db shell I get similar:
The default works fine if I run a SQL command in the shell though: