Generating types not working for enums: Field name 'request_status' works fine in the UI, but when the types are generated, it uses other values ("PENDING" | "SUCCESS" | "ERROR") #1689
Field name 'request_status' works fine in the UI, but when the types are generated, it uses other values ("PENDING" | "SUCCESS" | "ERROR")
To Reproduce
In a Nuxt app with supabase, I created 2 enum types as such, then when generating the types, I get statusA: "PENDING" | "SUCCESS" | "ERROR" for toto_bug instead of the correct statusA: Database["public"]["Enums"]["my_custom_status"] for toto_fine. But it works as expected for both tables in the UI editor (I can use 'approved' for instance).
CREATE TYPE "public"."request_status" AS ENUM (
'pending',
'approved',
'refused',
'cancelled'
);
CREATE TABLE IF NOT EXISTS "public"."toto_bug" (
"id" "uuid" DEFAULT "gen_random_uuid"() NOT NULL,
"statusP" "public"."request_status" DEFAULT 'pending'::"public"."request_status" NOT NULL,
"statusA" "public"."request_status" DEFAULT 'approved'::"public"."request_status" NOT NULL,
"statusR" "public"."request_status" DEFAULT 'refused'::"public"."request_status" NOT NULL,
"statusC" "public"."request_status" DEFAULT 'cancelled'::"public"."request_status" NOT NULL
);
CREATE TYPE "public"."my_custom_status" AS ENUM (
'pending',
'approved',
'refused',
'cancelled'
);
CREATE TABLE IF NOT EXISTS "public"."toto_fine" (
"id" "uuid" DEFAULT "gen_random_uuid"() NOT NULL,
"statusP" "public"."my_custom_status" DEFAULT 'pending'::"public"."my_custom_status" NOT NULL,
"statusA" "public"."my_custom_status" DEFAULT 'approved'::"public"."my_custom_status" NOT NULL,
"statusR" "public"."my_custom_status" DEFAULT 'refused'::"public"."my_custom_status" NOT NULL,
"statusC" "public"."my_custom_status" DEFAULT 'cancelled'::"public"."my_custom_status" NOT NULL
);
Expected behavior
A clear and concise description of what you expected to happen.
Bug report
Describe the bug
Field name 'request_status' works fine in the UI, but when the types are generated, it uses other values ("PENDING" | "SUCCESS" | "ERROR")
To Reproduce
In a Nuxt app with supabase, I created 2 enum types as such, then when generating the types, I get
statusA: "PENDING" | "SUCCESS" | "ERROR"
fortoto_bug
instead of the correctstatusA: Database["public"]["Enums"]["my_custom_status"]
fortoto_fine
. But it works as expected for both tables in the UI editor (I can use 'approved' for instance).Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
System information
Additional context
Add any other context about the problem here.