`CREATE TYPE "page_visibility_enum" AS ENUM('public', 'followers', 'specified')`,
);
awaitqueryRunner.query(
`CREATE TABLE "page" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "title" character varying(256) NOT NULL, "name" character varying(256) NOT NULL, "summary" character varying(256), "alignCenter" boolean NOT NULL, "font" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "eyeCatchingImageId" character varying(32), "content" jsonb NOT NULL DEFAULT '[]', "variables" jsonb NOT NULL DEFAULT '[]', "visibility" "page_visibility_enum" NOT NULL, "visibleUserIds" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], CONSTRAINT "PK_742f4117e065c5b6ad21b37ba1f" PRIMARY KEY ("id"))`,
);
awaitqueryRunner.query(
`CREATE INDEX "IDX_fbb4297c927a9b85e9cefa2eb1" ON "page" ("createdAt") `,
);
awaitqueryRunner.query(
`CREATE INDEX "IDX_af639b066dfbca78b01a920f8a" ON "page" ("updatedAt") `,
);
awaitqueryRunner.query(
`CREATE INDEX "IDX_b82c19c08afb292de4600d99e4" ON "page" ("name") `,
);
awaitqueryRunner.query(
`CREATE INDEX "IDX_ae1d917992dd0c9d9bbdad06c4" ON "page" ("userId") `,
);
awaitqueryRunner.query(
`CREATE INDEX "IDX_90148bbc2bf0854428786bfc15" ON "page" ("visibleUserIds") `,
);
awaitqueryRunner.query(
`CREATE UNIQUE INDEX "IDX_2133ef8317e4bdb839c0dcbf13" ON "page" ("userId", "name") `,
);
awaitqueryRunner.query(
`ALTER TABLE "page" ADD CONSTRAINT "FK_ae1d917992dd0c9d9bbdad06c4a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
);
awaitqueryRunner.query(
`ALTER TABLE "page" ADD CONSTRAINT "FK_3126dd7c502c9e4d7597ef7ef10" FOREIGN KEY ("eyeCatchingImageId") REFERENCES "drive_file"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
);
}
asyncdown(queryRunner){
awaitqueryRunner.query(
`ALTER TABLE "page" DROP CONSTRAINT "FK_3126dd7c502c9e4d7597ef7ef10"`,
);
awaitqueryRunner.query(
`ALTER TABLE "page" DROP CONSTRAINT "FK_ae1d917992dd0c9d9bbdad06c4a"`,
);
awaitqueryRunner.query(`DROP INDEX "IDX_2133ef8317e4bdb839c0dcbf13"`);
awaitqueryRunner.query(`DROP INDEX "IDX_90148bbc2bf0854428786bfc15"`);
awaitqueryRunner.query(`DROP INDEX "IDX_ae1d917992dd0c9d9bbdad06c4"`);
awaitqueryRunner.query(`DROP INDEX "IDX_b82c19c08afb292de4600d99e4"`);
awaitqueryRunner.query(`DROP INDEX "IDX_af639b066dfbca78b01a920f8a"`);
awaitqueryRunner.query(`DROP INDEX "IDX_fbb4297c927a9b85e9cefa2eb1"`);
awaitqueryRunner.query(`DROP TABLE "page"`);
awaitqueryRunner.query(`DROP TYPE "page_visibility_enum"`);