diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-01-11 20:38:34 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-11 20:38:34 +0900 |
| commit | 6c975275f82c79eed2c7757d55283c95d23ca5b8 (patch) | |
| tree | 2871e4c3a1a67295ea5c3e19b9136ae79a17088c /migration | |
| parent | fix context menu (diff) | |
| download | misskey-6c975275f82c79eed2c7757d55283c95d23ca5b8.tar.gz misskey-6c975275f82c79eed2c7757d55283c95d23ca5b8.tar.bz2 misskey-6c975275f82c79eed2c7757d55283c95d23ca5b8.zip | |
Registry (#7073)
* wip
* wip
* wip
* wip
* wip
* Update registry.value.vue
* wip
* wip
* wip
* wip
* typo
Diffstat (limited to 'migration')
| -rw-r--r-- | migration/1610277136869-registry.ts | 22 | ||||
| -rw-r--r-- | migration/1610277585759-registry2.ts | 16 | ||||
| -rw-r--r-- | migration/1610283021566-registry3.ts | 14 |
3 files changed, 52 insertions, 0 deletions
diff --git a/migration/1610277136869-registry.ts b/migration/1610277136869-registry.ts new file mode 100644 index 0000000000..46c8113c16 --- /dev/null +++ b/migration/1610277136869-registry.ts @@ -0,0 +1,22 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class registry1610277136869 implements MigrationInterface { + name = 'registry1610277136869' + + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`CREATE TABLE "registry_item" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "key" character varying(1024) NOT NULL, "scope" character varying(1024) array NOT NULL DEFAULT '{}'::varchar[], "domain" character varying(512), CONSTRAINT "PK_64b3f7e6008b4d89b826cd3af95" PRIMARY KEY ("id")); COMMENT ON COLUMN "registry_item"."createdAt" IS 'The created date of the RegistryItem.'; COMMENT ON COLUMN "registry_item"."updatedAt" IS 'The updated date of the RegistryItem.'; COMMENT ON COLUMN "registry_item"."userId" IS 'The owner ID.'; COMMENT ON COLUMN "registry_item"."key" IS 'The key of the RegistryItem.'`); + await queryRunner.query(`CREATE INDEX "IDX_fb9d21ba0abb83223263df6bcb" ON "registry_item" ("userId") `); + await queryRunner.query(`CREATE INDEX "IDX_22baca135bb8a3ea1a83d13df3" ON "registry_item" ("scope") `); + await queryRunner.query(`CREATE INDEX "IDX_0a72bdfcdb97c0eca11fe7ecad" ON "registry_item" ("domain") `); + await queryRunner.query(`ALTER TABLE "registry_item" ADD CONSTRAINT "FK_fb9d21ba0abb83223263df6bcb3" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + } + + public async down(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`ALTER TABLE "registry_item" DROP CONSTRAINT "FK_fb9d21ba0abb83223263df6bcb3"`); + await queryRunner.query(`DROP INDEX "IDX_0a72bdfcdb97c0eca11fe7ecad"`); + await queryRunner.query(`DROP INDEX "IDX_22baca135bb8a3ea1a83d13df3"`); + await queryRunner.query(`DROP INDEX "IDX_fb9d21ba0abb83223263df6bcb"`); + await queryRunner.query(`DROP TABLE "registry_item"`); + } + +} diff --git a/migration/1610277585759-registry2.ts b/migration/1610277585759-registry2.ts new file mode 100644 index 0000000000..2f2d80c486 --- /dev/null +++ b/migration/1610277585759-registry2.ts @@ -0,0 +1,16 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class registry21610277585759 implements MigrationInterface { + name = 'registry21610277585759' + + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`ALTER TABLE "registry_item" ADD "value" jsonb NOT NULL DEFAULT '{}'`); + await queryRunner.query(`COMMENT ON COLUMN "registry_item"."value" IS 'The value of the RegistryItem.'`); + } + + public async down(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`COMMENT ON COLUMN "registry_item"."value" IS 'The value of the RegistryItem.'`); + await queryRunner.query(`ALTER TABLE "registry_item" DROP COLUMN "value"`); + } + +} diff --git a/migration/1610283021566-registry3.ts b/migration/1610283021566-registry3.ts new file mode 100644 index 0000000000..61f235fb22 --- /dev/null +++ b/migration/1610283021566-registry3.ts @@ -0,0 +1,14 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class registry31610283021566 implements MigrationInterface { + name = 'registry31610283021566' + + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`ALTER TABLE "registry_item" ALTER COLUMN "value" DROP NOT NULL`); + } + + public async down(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`ALTER TABLE "registry_item" ALTER COLUMN "value" SET NOT NULL`); + } + +} |