fix migration, add create swipe route

This commit is contained in:
Pravdin Egor
2023-09-19 23:38:07 +07:00
parent bf38ec5355
commit 06cf4b129f
11 changed files with 175 additions and 21 deletions
+3 -1
View File
@@ -8,6 +8,7 @@ export class InitSchema1695130227420 implements MigrationInterface {
"name" varchar NOT NULL,
"password" varchar NOT NULL,
email varchar NOT NULL,
"createdAt" timestamp NOT NULL DEFAULT now(),
CONSTRAINT "users_pk" PRIMARY KEY (id),
CONSTRAINT "users_email_unique" UNIQUE (email)
);
@@ -18,7 +19,7 @@ export class InitSchema1695130227420 implements MigrationInterface {
"createdAt" timestamp NOT NULL DEFAULT now(),
"sourceUserId" int4 NULL,
"targetUserId" int4 NULL,
CONSTRAINT "PK_bb38af5831e2c084a78e3622ff6" PRIMARY KEY (id)
CONSTRAINT "swipes_pk" PRIMARY KEY (id)
);
ALTER TABLE swipes ADD CONSTRAINT "swipes_target_user_fk" FOREIGN KEY ("targetUserId") REFERENCES users(id);
@@ -26,6 +27,7 @@ export class InitSchema1695130227420 implements MigrationInterface {
CREATE TABLE pairs (
id serial4 NOT NULL,
"createdAt" timestamp NOT NULL DEFAULT now(),
CONSTRAINT "pairs_pk" PRIMARY KEY (id)
);