diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-05-04 15:05:34 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-04 15:05:34 +0900 |
| commit | 6ae642245e0322f194ca5d960f669f33ba38c2fa (patch) | |
| tree | f71ac2c1a2d0aa616d4e99d37c00787219c5e3d0 /migration | |
| parent | Fix style (diff) | |
| download | sharkey-6ae642245e0322f194ca5d960f669f33ba38c2fa.tar.gz sharkey-6ae642245e0322f194ca5d960f669f33ba38c2fa.tar.bz2 sharkey-6ae642245e0322f194ca5d960f669f33ba38c2fa.zip | |
Password reset (#7494)
* wip
* wip
* Update well-known.ts
* wip
* clean up
* Update request-reset-password.ts
* Update forgot-password.vue
* Update reset-password.ts
* Update request-reset-password.ts
Diffstat (limited to 'migration')
| -rw-r--r-- | migration/1619942102890-password-reset.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/migration/1619942102890-password-reset.ts b/migration/1619942102890-password-reset.ts new file mode 100644 index 0000000000..66854cb025 --- /dev/null +++ b/migration/1619942102890-password-reset.ts @@ -0,0 +1,20 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class passwordReset1619942102890 implements MigrationInterface { + name = 'passwordReset1619942102890' + + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`CREATE TABLE "password_reset_request" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "token" character varying(256) NOT NULL, "userId" character varying(32) NOT NULL, CONSTRAINT "PK_fcf4b02eae1403a2edaf87fd074" PRIMARY KEY ("id"))`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0b575fa9a4cfe638a925949285" ON "password_reset_request" ("token") `); + await queryRunner.query(`CREATE INDEX "IDX_4bb7fd4a34492ae0e6cc8d30ac" ON "password_reset_request" ("userId") `); + await queryRunner.query(`ALTER TABLE "password_reset_request" ADD CONSTRAINT "FK_4bb7fd4a34492ae0e6cc8d30ac8" 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 "password_reset_request" DROP CONSTRAINT "FK_4bb7fd4a34492ae0e6cc8d30ac8"`); + await queryRunner.query(`DROP INDEX "IDX_4bb7fd4a34492ae0e6cc8d30ac"`); + await queryRunner.query(`DROP INDEX "IDX_0b575fa9a4cfe638a925949285"`); + await queryRunner.query(`DROP TABLE "password_reset_request"`); + } + +} |