diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2019-07-07 06:56:13 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-07-07 06:56:13 +0900 |
| commit | bd8d7c3d0f1bb831f26a75a6107e34a85a1bc804 (patch) | |
| tree | f5c7f4d850ab00da5c800fa893f8319cf71b384a /migration | |
| parent | Use npx to avoid global install of ts-node (diff) | |
| download | sharkey-bd8d7c3d0f1bb831f26a75a6107e34a85a1bc804.tar.gz sharkey-bd8d7c3d0f1bb831f26a75a6107e34a85a1bc804.tar.bz2 sharkey-bd8d7c3d0f1bb831f26a75a6107e34a85a1bc804.zip | |
Improve Page
* ページをピン留めできるように
* デッキでカラム内でページを見れるように
Diffstat (limited to 'migration')
| -rw-r--r-- | migration/1562444565093-PinnedPage.ts | 17 | ||||
| -rw-r--r-- | migration/1562448332510-PageTitleHideOption.ts | 13 |
2 files changed, 30 insertions, 0 deletions
diff --git a/migration/1562444565093-PinnedPage.ts b/migration/1562444565093-PinnedPage.ts new file mode 100644 index 0000000000..4bdee22748 --- /dev/null +++ b/migration/1562444565093-PinnedPage.ts @@ -0,0 +1,17 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class PinnedPage1562444565093 implements MigrationInterface { + + public async up(queryRunner: QueryRunner): Promise<any> { + await queryRunner.query(`ALTER TABLE "user_profile" ADD "pinnedPageId" character varying(32)`); + await queryRunner.query(`ALTER TABLE "user_profile" ADD CONSTRAINT "UQ_6dc44f1ceb65b1e72bacef2ca27" UNIQUE ("pinnedPageId")`); + await queryRunner.query(`ALTER TABLE "user_profile" ADD CONSTRAINT "FK_6dc44f1ceb65b1e72bacef2ca27" FOREIGN KEY ("pinnedPageId") REFERENCES "page"("id") ON DELETE SET NULL ON UPDATE NO ACTION`); + } + + public async down(queryRunner: QueryRunner): Promise<any> { + await queryRunner.query(`ALTER TABLE "user_profile" DROP CONSTRAINT "FK_6dc44f1ceb65b1e72bacef2ca27"`); + await queryRunner.query(`ALTER TABLE "user_profile" DROP CONSTRAINT "UQ_6dc44f1ceb65b1e72bacef2ca27"`); + await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "pinnedPageId"`); + } + +} diff --git a/migration/1562448332510-PageTitleHideOption.ts b/migration/1562448332510-PageTitleHideOption.ts new file mode 100644 index 0000000000..acc9b7e26f --- /dev/null +++ b/migration/1562448332510-PageTitleHideOption.ts @@ -0,0 +1,13 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class PageTitleHideOption1562448332510 implements MigrationInterface { + + public async up(queryRunner: QueryRunner): Promise<any> { + await queryRunner.query(`ALTER TABLE "page" ADD "hideTitleWhenPinned" boolean NOT NULL DEFAULT false`); + } + + public async down(queryRunner: QueryRunner): Promise<any> { + await queryRunner.query(`ALTER TABLE "page" DROP COLUMN "hideTitleWhenPinned"`); + } + +} |