-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path1661291478011-Feed.ts
43 lines (39 loc) · 1.57 KB
/
1661291478011-Feed.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { MigrationInterface, QueryRunner } from "typeorm";
export class Feed1661291478011 implements MigrationInterface {
name = 'Feed1661291478011'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
CREATE TABLE "realm_feed_item" (
"id" SERIAL NOT NULL,
"data" jsonb NOT NULL,
"environment" character varying NOT NULL,
"metadata" jsonb NOT NULL,
"realmPublicKeyStr" character varying NOT NULL,
"created" TIMESTAMP NOT NULL DEFAULT now(),
"deleted" TIMESTAMP,
"updated" TIMESTAMP WITH TIME ZONE NOT NULL,
CONSTRAINT "PK_e24c04da3892a7573c1aa0d37ef" PRIMARY KEY ("id")
)
`);
await queryRunner.query(`
CREATE TABLE "realm_post" (
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
"data" jsonb NOT NULL,
"environment" character varying NOT NULL,
"realmPublicKeyStr" character varying NOT NULL,
"created" TIMESTAMP NOT NULL DEFAULT now(),
"deleted" TIMESTAMP,
"updated" TIMESTAMP NOT NULL DEFAULT now(),
CONSTRAINT "PK_656c881149a9a927ec98733bcc0" PRIMARY KEY ("id")
)
`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
DROP TABLE "realm_post"
`);
await queryRunner.query(`
DROP TABLE "realm_feed_item"
`);
}
}