Drizzle studio doesn't handle timestamps properly

I was trying to create some records into my users table:
CREATE TABLE `users` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`username` text NOT NULL,
`email` text NOT NULL,
`first_name` text NOT NULL,
`last_name` text,
`birthdate` integer,
`profile_photo` text,
`created_at` text DEFAULT (current_timestamp) NOT NULL,
`updated_at` text DEFAULT (current_timestamp) NOT NULL
);
CREATE TABLE `users` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`username` text NOT NULL,
`email` text NOT NULL,
`first_name` text NOT NULL,
`last_name` text,
`birthdate` integer,
`profile_photo` text,
`created_at` text DEFAULT (current_timestamp) NOT NULL,
`updated_at` text DEFAULT (current_timestamp) NOT NULL
);
when I add it via drizzle studio inside turso I get literaly (current_timestamp) as text instead of the actual timestamp. It worked fine adding it via SQL shell
No description
No description
3 Replies
Mykhailo
Mykhailo6mo ago
Hey @diurivj! thank you, this is bug and will be fixed
DiamondDragon
DiamondDragon6mo ago
@Mykhailo i have this passed into a fields table using pg. i'm noticing the timestamp is shown incorrectly in studio. In beekeeper its correct
export const dateFields = {
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at'),
}
export const dateFields = {
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at'),
}
No description
No description
No description
Mykhailo
Mykhailo6mo ago
Hey @DiamondDragon. I will reproduce this issue and will reply later
Want results from more Discord servers?
Add your server