Open L-Mario564 opened 4 weeks ago
drizzle-orm
?
drizzle-kit
From drizzle-kit-mirror repo: https://github.com/drizzle-team/drizzle-kit-mirror/issues/33.
We have a table like this: And it generates a schema like this: export const timeoutLocks = pgTable("timeout_locks", { acquiredAt: timestamp("acquiredAt", { withTimezone: true, mode: 'string' }) .default((now() AT TIME ZONE 'utc'::text)), id: uuid("id").notNull(), }, (table) => { return { idKey: uniqueIndex("timeout_locks_id_key").on(table.id), } }); With the line .default((now() AT TIME ZONE 'utc'::text)), Being an issue - this is invalid JavaScript. Seems like there's special handling of default: now(), while other defaults get expressions with the sql helper, and this is stuck in the middle.
We have a table like this:
And it generates a schema like this:
export const timeoutLocks = pgTable("timeout_locks", { acquiredAt: timestamp("acquiredAt", { withTimezone: true, mode: 'string' }) .default((now() AT TIME ZONE 'utc'::text)), id: uuid("id").notNull(), }, (table) => { return { idKey: uniqueIndex("timeout_locks_id_key").on(table.id), } });
With the line
.default((now() AT TIME ZONE 'utc'::text)),
Being an issue - this is invalid JavaScript. Seems like there's special handling of default: now(), while other defaults get expressions with the sql helper, and this is stuck in the middle.
No response
any update ?
What version of
drizzle-orm
are you using??
What version of
drizzle-kit
are you using??
Describe the Bug
From drizzle-kit-mirror repo: https://github.com/drizzle-team/drizzle-kit-mirror/issues/33.
Expected behavior
No response
Environment & setup
No response