You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Database file generated using the dashboard or the command line doesn't generate correct data types for TIMESTAMP(0). Should be a Date type and so should the underlying data insteadof string.
To Reproduce
Use either approach below to generate database files for a profiles table as described below.
CREATE TABLE "profiles" (
"id" UUID PRIMARY KEY REFERENCES auth.users ON DELETE CASCADE,
"email" TEXT UNIQUE NOT NULL,
"firstName" TEXT,
"lastName" TEXT,
"createdAt" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(0)
);
anshul-kai
changed the title
Database file generated doesn't output correct type for TIMESTAMP
Database file generated doesn't output correct type for TIMESTAMP(0)
Sep 5, 2024
I'm running into the same issue. Right now I'm manually editing the generated files to replace string with Date but that is only a short-term solution. Ideally there should be a way to define how the timestamp type (and possibly other types) are exposed in the generated types. Is that something that is on the roadmap?
Bug report
Describe the bug
Database file generated using the dashboard or the command line doesn't generate correct data types for TIMESTAMP(0). Should be a
Date
type and so should the underlying data insteadofstring
.To Reproduce
Use either approach below to generate database files for a
profiles
table as described below.Approach 1
https://supabase.com/dashboard/project/_/api?page=tables-intro
Approach 2
File Generated
Expected behavior
createdAt
andupdatedAt
should be of typeDate
instead ofstring
The text was updated successfully, but these errors were encountered: