I am currently developing an app using NestJs with a Postgres database and TypeOrm as the ORM. I have created my migration file, configured the package.json file, but when I try to run yarn typeorm migration:run
, I encounter the following error:
query failed: CREATE TABLE "users" ("id" NOT NULL, "name" varchar NOT NULL, "email" varchar NOT NULL, "password" varchar NOT NULL, "biography" varchar NOT NULL, "links" varchar NOT NULL, "posts" int NOT NULL, "created_at" date NOT NULL DEFAULT now(), CONSTRAINT "UQ_97672ac88f789774dd47f7c8be3" UNIQUE ("email"), CONSTRAINT "posts" FOREIGN KEY ("posts") REFERENCES "posts" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "PK_a3ffb1c0c8416b9fc6f907b7433" PRIMARY KEY ("id"))
error: error: syntax error at or near "NOT"
(...)
The complete migration code is quite large, so here is the link for it: https://pastebin.com/Ww2d0F16
I have searched extensively for a solution to this error but couldn't find anything relevant. Can someone please assist me in resolving this issue?