summary refs log tree commit diff
path: root/src/util/migration/postgres/1675044825710-webauthn.ts
diff options
context:
space:
mode:
authorEmma [it/its]@Rory& <root@rory.gay>2023-12-11 01:12:54 +0100
committerEmma [it/its]@Rory& <root@rory.gay>2023-12-11 01:12:54 +0100
commit0a8ceb9e6349284e75545a01ffad608b020f78e2 (patch)
tree17a9163f963eddabf9168b0b630096b2f7535b64 /src/util/migration/postgres/1675044825710-webauthn.ts
parentPrettier: use editorconfig (diff)
downloadserver-dev/emma-refactors.tar.xz
Actually run prettier dev/emma-refactors
Diffstat (limited to '')
-rw-r--r--src/util/migration/postgres/1675044825710-webauthn.ts16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/util/migration/postgres/1675044825710-webauthn.ts b/src/util/migration/postgres/1675044825710-webauthn.ts

index 4b32d6c7..749ff90a 100644 --- a/src/util/migration/postgres/1675044825710-webauthn.ts +++ b/src/util/migration/postgres/1675044825710-webauthn.ts
@@ -23,23 +23,17 @@ export class webauthn1675044825710 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise<void> { await queryRunner.query( - `CREATE TABLE "security_keys" ("id" character varying NOT NULL, "user_id" character varying, "key_id" character varying NOT NULL, "public_key" character varying NOT NULL, "counter" integer NOT NULL, "name" character varying NOT NULL, CONSTRAINT "PK_6e95cdd91779e7cca06d1fff89c" PRIMARY KEY ("id"))`, + `CREATE TABLE "security_keys" ("id" character varying NOT NULL, "user_id" character varying, "key_id" character varying NOT NULL, "public_key" character varying NOT NULL, "counter" integer NOT NULL, "name" character varying NOT NULL, CONSTRAINT "PK_6e95cdd91779e7cca06d1fff89c" PRIMARY KEY ("id"))` ); + await queryRunner.query(`ALTER TABLE "users" ADD "webauthn_enabled" boolean NOT NULL DEFAULT false`); await queryRunner.query( - `ALTER TABLE "users" ADD "webauthn_enabled" boolean NOT NULL DEFAULT false`, - ); - await queryRunner.query( - `ALTER TABLE "security_keys" ADD CONSTRAINT "FK_24c97d0771cafedce6d7163eaad" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + `ALTER TABLE "security_keys" ADD CONSTRAINT "FK_24c97d0771cafedce6d7163eaad" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE NO ACTION` ); } public async down(queryRunner: QueryRunner): Promise<void> { - await queryRunner.query( - `ALTER TABLE "security_keys" DROP CONSTRAINT "FK_24c97d0771cafedce6d7163eaad"`, - ); - await queryRunner.query( - `ALTER TABLE "users" DROP COLUMN "webauthn_enabled"`, - ); + await queryRunner.query(`ALTER TABLE "security_keys" DROP CONSTRAINT "FK_24c97d0771cafedce6d7163eaad"`); + await queryRunner.query(`ALTER TABLE "users" DROP COLUMN "webauthn_enabled"`); await queryRunner.query(`DROP TABLE "security_keys"`); } }