-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path1660048272853-User.ts
28 lines (24 loc) · 998 Bytes
/
1660048272853-User.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { MigrationInterface, QueryRunner } from "typeorm";
export class User1660048272853 implements MigrationInterface {
name = 'User1660048272853'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
CREATE TABLE "user" (
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
"data" jsonb NOT NULL,
"authId" character varying NOT NULL,
"publicKeyStr" character varying NOT NULL,
"created" TIMESTAMP NOT NULL DEFAULT now(),
"deleted" TIMESTAMP,
"updated" TIMESTAMP NOT NULL DEFAULT now(),
CONSTRAINT "UQ_ad5065ee18a722baaa932d1c3c6" UNIQUE ("authId"),
CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id")
)
`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
DROP TABLE "user"
`);
}
}