SQLite functions not being called

I think I might've found a bug. At least in Studio, maybe in orm as well. Could someone please verify? For a following table:
export const organizations = sqliteTable(
"users",
{
id: text("id")
.primaryKey()
.default(sql`(uuid4())`),
email: text("email").notNull(),
updatedAt: text("updated_at")
.notNull()
.default(sql`current_timestamp`),
);
export const organizations = sqliteTable(
"users",
{
id: text("id")
.primaryKey()
.default(sql`(uuid4())`),
email: text("email").notNull(),
updatedAt: text("updated_at")
.notNull()
.default(sql`current_timestamp`),
);
the following SQL query is generated:
CREATE TABLE `users` (
`id` text PRIMARY KEY DEFAULT (uuid4()) NOT NULL,
`email` text NOT NULL,
`updated_at` text DEFAULT current_timestamp NOT NULL
);
CREATE TABLE `users` (
`id` text PRIMARY KEY DEFAULT (uuid4()) NOT NULL,
`email` text NOT NULL,
`updated_at` text DEFAULT current_timestamp NOT NULL
);
When I add a new record via Drizzle Studio, I noticed that the SQLite functions are not being fired. They work fine when adding records manually using SQL queries but not when I use Drizzle Runner or via "Add record" button. Interestingly, the behaviour is slightly different in both cases. I presume the same error will occur when executing the queries from code.
No description
0 Replies
No replies yetBe the first to reply to this messageJoin