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
{{ message }}
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
I have Postgres 10 instance with a keyword table with an uuid column like this:
CREATE TABLE "keyword" (
"uuid" "uuid" DEFAULT "public"."uuid_generate_v4"() PRIMARY KEY,
"createdDate" timestamp without time zone NOT NULL DEFAULT now(),
"updatedDate" timestamp without time zone NOT NULL DEFAULT now(),
"name" varchar(250) NOT NULL,
"language" varchar NOT NULL,
"status" varchar NOT NULL DEFAULT ('CREATED')
)
When I try to create a new entity from the interface, there is this error: null value in column "uuid" violates not-null constraint.
Setting defaultValue: Sequelize.literal('uuid_generate_v4()'), fixes it.
The text was updated successfully, but these errors were encountered:
prevostc
changed the title
Can't create a new entity, default value ignored
Default value ignored
Aug 6, 2018
arnaudbesnier
changed the title
Default value ignored
[+] Default Values - Lumber should generate the models based on the columns default values
Aug 23, 2018
Hi @p0wl, if you encounter the same issue, I guess it is still a problem.
Is that what you observe?
A workaround is described in the issue description:
you'll have to edit manually the model fields definitions with the right default value declaration.
Hey, sorry for the unspecific comment. Yes, the issue with non-null default values is still present. My table definition looks like this:
CREATE TABLE public.something
(
id uuid NOT NULL DEFAULT uuid_generate_v4(),
"number" integer NOT NULL,
name character(255) COLLATE pg_catalog."default",
CONSTRAINT bikes_pkey PRIMARY KEY (id)
)
but creating a row in ForestAdmin fails with "Something creation failed: null value in column "id" violates not-null constraint".
I can fix it with adding the default value (defaultValue: sequelize.literal('uuid_generate_v4()'),), but I think this should not be necessary, right?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have Postgres 10 instance with a keyword table with an uuid column like this:
When I try to create a new entity from the interface, there is this error:
null value in column "uuid" violates not-null constraint
.Setting
defaultValue: Sequelize.literal('uuid_generate_v4()'),
fixes it.The text was updated successfully, but these errors were encountered: