From 3a3417cded637b8f582ebd04dedefc2c117d25cd Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sun, 4 Sep 2022 10:44:33 +0200 Subject: Prettier --- .../mariadb/1661885910534-guild-member-profiles.ts | 27 ++++++++--------- .../1661885830688-guild-member-profiles.ts | 27 ++++++++--------- .../sqlite/1661885742207-guild-member-profiles.ts | 35 +++++++++++----------- 3 files changed, 43 insertions(+), 46 deletions(-) (limited to 'src/util/migrations') diff --git a/src/util/migrations/mariadb/1661885910534-guild-member-profiles.ts b/src/util/migrations/mariadb/1661885910534-guild-member-profiles.ts index 6e1ac3f8..21ee2027 100644 --- a/src/util/migrations/mariadb/1661885910534-guild-member-profiles.ts +++ b/src/util/migrations/mariadb/1661885910534-guild-member-profiles.ts @@ -1,40 +1,39 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class guildMemberProfiles1661885910534 implements MigrationInterface { - name = 'guildMemberProfiles1661885910534' + name = "guildMemberProfiles1661885910534"; - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(` + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` ALTER TABLE \`members\` ADD \`avatar\` varchar(255) NULL `); - await queryRunner.query(` + await queryRunner.query(` ALTER TABLE \`members\` ADD \`banner\` varchar(255) NULL `); - await queryRunner.query(` + await queryRunner.query(` ALTER TABLE \`members\` ADD \`bio\` varchar(255) NOT NULL `); - await queryRunner.query(` + await queryRunner.query(` ALTER TABLE \`members\` ADD \`communication_disabled_until\` datetime NULL `); - } + } - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(` + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(` ALTER TABLE \`members\` DROP COLUMN \`communication_disabled_until\` `); - await queryRunner.query(` + await queryRunner.query(` ALTER TABLE \`members\` DROP COLUMN \`bio\` `); - await queryRunner.query(` + await queryRunner.query(` ALTER TABLE \`members\` DROP COLUMN \`banner\` `); - await queryRunner.query(` + await queryRunner.query(` ALTER TABLE \`members\` DROP COLUMN \`avatar\` `); - } - + } } diff --git a/src/util/migrations/postgres/1661885830688-guild-member-profiles.ts b/src/util/migrations/postgres/1661885830688-guild-member-profiles.ts index 81671250..c6b69234 100644 --- a/src/util/migrations/postgres/1661885830688-guild-member-profiles.ts +++ b/src/util/migrations/postgres/1661885830688-guild-member-profiles.ts @@ -1,40 +1,39 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class guildMemberProfiles1661885830688 implements MigrationInterface { - name = 'guildMemberProfiles1661885830688' + name = "guildMemberProfiles1661885830688"; - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(` + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` ALTER TABLE "members" ADD "avatar" character varying `); - await queryRunner.query(` + await queryRunner.query(` ALTER TABLE "members" ADD "banner" character varying `); - await queryRunner.query(` + await queryRunner.query(` ALTER TABLE "members" ADD "bio" character varying NOT NULL default '' `); - await queryRunner.query(` + await queryRunner.query(` ALTER TABLE "members" ADD "communication_disabled_until" TIMESTAMP `); - } + } - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(` + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(` ALTER TABLE "members" DROP COLUMN "communication_disabled_until" `); - await queryRunner.query(` + await queryRunner.query(` ALTER TABLE "members" DROP COLUMN "bio" `); - await queryRunner.query(` + await queryRunner.query(` ALTER TABLE "members" DROP COLUMN "banner" `); - await queryRunner.query(` + await queryRunner.query(` ALTER TABLE "members" DROP COLUMN "avatar" `); - } - + } } diff --git a/src/util/migrations/sqlite/1661885742207-guild-member-profiles.ts b/src/util/migrations/sqlite/1661885742207-guild-member-profiles.ts index 24ec9c72..03932c3a 100644 --- a/src/util/migrations/sqlite/1661885742207-guild-member-profiles.ts +++ b/src/util/migrations/sqlite/1661885742207-guild-member-profiles.ts @@ -1,13 +1,13 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class guildMemberProfiles1661885742207 implements MigrationInterface { - name = 'guildMemberProfiles1661885742207' + name = "guildMemberProfiles1661885742207"; - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(` + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` DROP INDEX "IDX_bb2bf9386ac443afbbbf9f12d3" `); - await queryRunner.query(` + await queryRunner.query(` CREATE TABLE "temporary_members" ( "index" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "id" varchar NOT NULL, @@ -29,7 +29,7 @@ export class guildMemberProfiles1661885742207 implements MigrationInterface { CONSTRAINT "FK_16aceddd5b89825b8ed6029ad1c" FOREIGN KEY ("guild_id") REFERENCES "guilds" ("id") ON DELETE CASCADE ON UPDATE NO ACTION ) `); - await queryRunner.query(` + await queryRunner.query(` INSERT INTO "temporary_members"( "index", "id", @@ -58,27 +58,27 @@ export class guildMemberProfiles1661885742207 implements MigrationInterface { "joined_by" FROM "members" `); - await queryRunner.query(` + await queryRunner.query(` DROP TABLE "members" `); - await queryRunner.query(` + await queryRunner.query(` ALTER TABLE "temporary_members" RENAME TO "members" `); - await queryRunner.query(` + await queryRunner.query(` CREATE UNIQUE INDEX "IDX_bb2bf9386ac443afbbbf9f12d3" ON "members" ("id", "guild_id") `); - } + } - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(` + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(` DROP INDEX "IDX_bb2bf9386ac443afbbbf9f12d3" `); - await queryRunner.query(` + await queryRunner.query(` ALTER TABLE "members" RENAME TO "temporary_members" `); - await queryRunner.query(` + await queryRunner.query(` CREATE TABLE "members" ( "index" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "id" varchar NOT NULL, @@ -96,7 +96,7 @@ export class guildMemberProfiles1661885742207 implements MigrationInterface { CONSTRAINT "FK_16aceddd5b89825b8ed6029ad1c" FOREIGN KEY ("guild_id") REFERENCES "guilds" ("id") ON DELETE CASCADE ON UPDATE NO ACTION ) `); - await queryRunner.query(` + await queryRunner.query(` INSERT INTO "members"( "index", "id", @@ -125,12 +125,11 @@ export class guildMemberProfiles1661885742207 implements MigrationInterface { "joined_by" FROM "temporary_members" `); - await queryRunner.query(` + await queryRunner.query(` DROP TABLE "temporary_members" `); - await queryRunner.query(` + await queryRunner.query(` CREATE UNIQUE INDEX "IDX_bb2bf9386ac443afbbbf9f12d3" ON "members" ("id", "guild_id") `); - } - + } } -- cgit 1.5.1