I am having an issue where insert statements with multiple rows, into tables with columns that have default values are failing with the following error: "null value in column "x" violates not-null constraint"
To Reproduce
The SQL to create the table is:
CREATE TABLE "clinic_flow_series_definition_entity" ("createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "id" character varying(255) NOT NULL, "name" character varying(255) NOT NULL, "alternateSeries" boolean NOT NULL DEFAULT false, "type" "public"."clinic_flow_series_definition_entity_type_enum" NOT NULL DEFAULT 'Primary', "seriesDoseCount" integer NOT NULL, "intervals" jsonb NOT NULL, "conceptId" character varying(255), "targetDiseaseId" character varying(255) NOT NULL DEFAULT '840539006', "forecastRuleId" character varying(255) NOT NULL, "deleted" boolean NOT NULL DEFAULT false, "dependentSeriesType" "public"."clinic_flow_series_definition_entity_dependentseriestype_enum", "ageRanges" jsonb NOT NULL DEFAULT '[]', CONSTRAINT "PK_0ccfaa50690078435f73d09420a" PRIMARY KEY ("id"))
When I run an insert statement with a single row like this, it works and the default values are set:
Describe the bug
I am having an issue where insert statements with multiple rows, into tables with columns that have default values are failing with the following error: "null value in column "x" violates not-null constraint"
To Reproduce
The SQL to create the table is:
When I run an insert statement with a single row like this, it works and the default values are set:
However, if I run an insert with multiple rows, as in the Failed SQL statement below, I get the following error:
pg-mem version
2.5.0
I'm generating these queries with Typeorm v0.3.6.
Thanks for creating this library!