Closed spa5k closed 8 months ago
Hi @spa5k,
I'm having a problem to reproduce the bug. Generator successfully generates code for application_user
table. Could you share how application_user_id
and customer_id
is defined.
Error trace points to operator error. It seems you are trying to compare somewhere typeid
and varchar
, which is not allowed.
Hey, the tables are like this -
CREATE DOMAIN user_id AS typeid CHECK (typeid_check(value, 'user'));
create table "user"
(
id user_id primary key not null default typeid_generate('user'),
access_failed_count integer not null default 0,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now()
);
I'm using the typeid from the jetpack-io/typeid as Primary key, so the type it returns is basically a tuple of string and uuid.
Hey I was able to fix it up, so basically in this file - https://github.com/jetpack-io/typeid-sql/blob/main/sql/03_typeid.sql, they were using VARCHAR and sometimes with fixed length of 63, I basically replaced it with text and it worked.
Describe the bug It's giving error while generating the types
Environment (please complete the following information):
Code snippet
https://github.com/jetpack-io/typeid
Using this as the primary key Expected behavior It should translate the typeid to
text