gen_random_uuid not working
hi. I am trying to use postgress db provisioned on railway with drizzle. my schema look like
id: uuid('id').default(sql'gen_random_uuid()')
but on insert into this db I get error
PostgresError: null value in column "id" of relation "file" violates not-null constraint
is it possible that my db does not have this function? if so what should I do to create column with autogenerated uuid ? thanks!Solution:Jump to solution
you would first need to enable the pgcrypto extension, do that by running this query -
...
3 Replies