summary refs log tree commit diff
path: root/src/util/migrations/sqlite/1660549233583-fix_nullables.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-25 12:55:42 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-25 13:00:31 +1000
commitd946547a9233d866e793e1c68f11d98cb2f7d390 (patch)
tree2ff2677432e2e874f0784b115202f3846e68deb0 /src/util/migrations/sqlite/1660549233583-fix_nullables.ts
parentMerge remote-tracking branch 'upstream/staging' into fix/categoryNames (diff)
parentMerge pull request #799 from MaddyUnderStars/feat/captchaVerify (diff)
downloadserver-d946547a9233d866e793e1c68f11d98cb2f7d390.tar.xz
Merge remote-tracking branch 'upstream/staging' into fix/categoryNames
Also allow voice to skip checks
Diffstat (limited to '')
-rw-r--r--src/util/migrations/sqlite/1660549233583-fix_nullables.ts27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/util/migrations/sqlite/1660549233583-fix_nullables.ts b/src/util/migrations/sqlite/1660549233583-fix_nullables.ts

index 68f650c7..fa60bdc1 100644 --- a/src/util/migrations/sqlite/1660549233583-fix_nullables.ts +++ b/src/util/migrations/sqlite/1660549233583-fix_nullables.ts
@@ -1,10 +1,10 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class fixNullables1660549233583 implements MigrationInterface { - name = 'fixNullables1660549233583' + name = "fixNullables1660549233583"; - public async up(queryRunner: QueryRunner): Promise<void> { - await queryRunner.query(` + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(` CREATE TABLE "temporary_users" ( "id" varchar PRIMARY KEY NOT NULL, "username" varchar NOT NULL, @@ -42,7 +42,7 @@ export class fixNullables1660549233583 implements MigrationInterface { CONSTRAINT "FK_76ba283779c8441fd5ff819c8cf" FOREIGN KEY ("settingsId") REFERENCES "user_settings" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION ) `); - await queryRunner.query(` + await queryRunner.query(` INSERT INTO "temporary_users"( "id", "username", @@ -111,21 +111,21 @@ export class fixNullables1660549233583 implements MigrationInterface { "settingsId" FROM "users" `); - await queryRunner.query(` + await queryRunner.query(` DROP TABLE "users" `); - await queryRunner.query(` + await queryRunner.query(` ALTER TABLE "temporary_users" RENAME TO "users" `); - } + } - public async down(queryRunner: QueryRunner): Promise<void> { - await queryRunner.query(` + public async down(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(` ALTER TABLE "users" RENAME TO "temporary_users" `); - await queryRunner.query(` + await queryRunner.query(` CREATE TABLE "users" ( "id" varchar PRIMARY KEY NOT NULL, "username" varchar NOT NULL, @@ -163,7 +163,7 @@ export class fixNullables1660549233583 implements MigrationInterface { CONSTRAINT "FK_76ba283779c8441fd5ff819c8cf" FOREIGN KEY ("settingsId") REFERENCES "user_settings" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION ) `); - await queryRunner.query(` + await queryRunner.query(` INSERT INTO "users"( "id", "username", @@ -232,9 +232,8 @@ export class fixNullables1660549233583 implements MigrationInterface { "settingsId" FROM "temporary_users" `); - await queryRunner.query(` + await queryRunner.query(` DROP TABLE "temporary_users" `); - } - + } }