diff --git a/src/util/migration/postgres/1673609867556-templateDeleteCascade.ts b/src/util/migration/postgres/1673609867556-templateDeleteCascade.ts
index ba0025d3..dbeef998 100644
--- a/src/util/migration/postgres/1673609867556-templateDeleteCascade.ts
+++ b/src/util/migration/postgres/1673609867556-templateDeleteCascade.ts
@@ -19,19 +19,19 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class templateDeleteCascade1673609867556 implements MigrationInterface {
- name = "templateDeleteCascade1673609867556";
+ name = "templateDeleteCascade1673609867556";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "templates" DROP CONSTRAINT "FK_445d00eaaea0e60a017a5ed0c11"`);
- await queryRunner.query(
- `ALTER TABLE "templates" ADD CONSTRAINT "FK_445d00eaaea0e60a017a5ed0c11" FOREIGN KEY ("source_guild_id") REFERENCES "guilds"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
- );
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "templates" DROP CONSTRAINT "FK_445d00eaaea0e60a017a5ed0c11"`);
+ await queryRunner.query(
+ `ALTER TABLE "templates" ADD CONSTRAINT "FK_445d00eaaea0e60a017a5ed0c11" FOREIGN KEY ("source_guild_id") REFERENCES "guilds"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
+ );
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "templates" DROP CONSTRAINT "FK_445d00eaaea0e60a017a5ed0c11"`);
- await queryRunner.query(
- `ALTER TABLE "templates" ADD CONSTRAINT "FK_445d00eaaea0e60a017a5ed0c11" FOREIGN KEY ("source_guild_id") REFERENCES "guilds"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
- );
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "templates" DROP CONSTRAINT "FK_445d00eaaea0e60a017a5ed0c11"`);
+ await queryRunner.query(
+ `ALTER TABLE "templates" ADD CONSTRAINT "FK_445d00eaaea0e60a017a5ed0c11" FOREIGN KEY ("source_guild_id") REFERENCES "guilds"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
+ );
+ }
}
diff --git a/src/util/migration/postgres/1675044825710-webauthn.ts b/src/util/migration/postgres/1675044825710-webauthn.ts
index 19a96b4d..5c052ccf 100644
--- a/src/util/migration/postgres/1675044825710-webauthn.ts
+++ b/src/util/migration/postgres/1675044825710-webauthn.ts
@@ -19,21 +19,21 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class webauthn1675044825710 implements MigrationInterface {
- name = "webauthn1675044825710";
+ name = "webauthn1675044825710";
- 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"))`,
- );
- 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`,
- );
- }
+ 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"))`,
+ );
+ 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`,
+ );
+ }
- 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(`DROP TABLE "security_keys"`);
- }
+ 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(`DROP TABLE "security_keys"`);
+ }
}
diff --git a/src/util/migration/postgres/1696420827239-guildChannelOrdering.ts b/src/util/migration/postgres/1696420827239-guildChannelOrdering.ts
index 4848ffd0..2323ae6a 100644
--- a/src/util/migration/postgres/1696420827239-guildChannelOrdering.ts
+++ b/src/util/migration/postgres/1696420827239-guildChannelOrdering.ts
@@ -1,38 +1,38 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class guildChannelOrdering1696420827239 implements MigrationInterface {
- name = "guildChannelOrdering1696420827239";
+ name = "guildChannelOrdering1696420827239";
- public async up(queryRunner: QueryRunner): Promise<void> {
- const guilds = await queryRunner.query(`SELECT id FROM guilds`, undefined, true);
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ const guilds = await queryRunner.query(`SELECT id FROM guilds`, undefined, true);
- await queryRunner.query(`ALTER TABLE guilds ADD channel_ordering text NOT NULL DEFAULT '[]'`);
+ await queryRunner.query(`ALTER TABLE guilds ADD channel_ordering text NOT NULL DEFAULT '[]'`);
- for (const guild_id of guilds.records.map((x) => x.id)) {
- const channels: Array<{ position: number; id: string }> = (await queryRunner.query(`SELECT id, position FROM channels WHERE guild_id = $1`, [guild_id], true)).records;
+ for (const guild_id of guilds.records.map((x) => x.id)) {
+ const channels: Array<{ position: number; id: string }> = (await queryRunner.query(`SELECT id, position FROM channels WHERE guild_id = $1`, [guild_id], true)).records;
- channels.sort((a, b) => a.position - b.position);
+ channels.sort((a, b) => a.position - b.position);
- await queryRunner.query(`UPDATE guilds SET channel_ordering = $1 WHERE id = $2`, [JSON.stringify(channels.map((x) => x.id)), guild_id]);
- }
+ await queryRunner.query(`UPDATE guilds SET channel_ordering = $1 WHERE id = $2`, [JSON.stringify(channels.map((x) => x.id)), guild_id]);
+ }
- await queryRunner.query(`ALTER TABLE channels DROP COLUMN position`);
- }
+ await queryRunner.query(`ALTER TABLE channels DROP COLUMN position`);
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE channels ADD position integer NOT NULL DEFAULT 0`);
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE channels ADD position integer NOT NULL DEFAULT 0`);
- const guilds = await queryRunner.query(`SELECT id, channel_ordering FROM guilds`, undefined, true);
+ const guilds = await queryRunner.query(`SELECT id, channel_ordering FROM guilds`, undefined, true);
- for (const guild of guilds.records) {
- const channel_ordering: string[] = JSON.parse(guild.channel_ordering);
+ for (const guild of guilds.records) {
+ const channel_ordering: string[] = JSON.parse(guild.channel_ordering);
- for (let i = 0; i < channel_ordering.length; i++) {
- const channel_id = channel_ordering[i];
- await queryRunner.query(`UPDATE channels SET position = $1 WHERE id = $2`, [i, channel_id]);
- }
- }
+ for (let i = 0; i < channel_ordering.length; i++) {
+ const channel_id = channel_ordering[i];
+ await queryRunner.query(`UPDATE channels SET position = $1 WHERE id = $2`, [i, channel_id]);
+ }
+ }
- await queryRunner.query(`ALTER TABLE guilds DROP COLUMN channel_ordering`);
- }
+ await queryRunner.query(`ALTER TABLE guilds DROP COLUMN channel_ordering`);
+ }
}
diff --git a/src/util/migration/postgres/1713116476900-messageFlagsNotNull.ts b/src/util/migration/postgres/1713116476900-messageFlagsNotNull.ts
index afec6854..57948bc3 100644
--- a/src/util/migration/postgres/1713116476900-messageFlagsNotNull.ts
+++ b/src/util/migration/postgres/1713116476900-messageFlagsNotNull.ts
@@ -1,19 +1,19 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class MessageFlagsNotNull1713116476900 implements MigrationInterface {
- name = "MessageFlagsNotNull1713116476900";
+ name = "MessageFlagsNotNull1713116476900";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE messages RENAME COLUMN flags TO flags_old;");
- await queryRunner.query("ALTER TABLE messages ADD COLUMN flags integer NOT NULL DEFAULT 0;");
- await queryRunner.query("UPDATE messages SET flags = COALESCE(flags_old, 0);");
- await queryRunner.query("ALTER TABLE messages DROP COLUMN flags_old;");
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE messages RENAME COLUMN flags TO flags_old;");
+ await queryRunner.query("ALTER TABLE messages ADD COLUMN flags integer NOT NULL DEFAULT 0;");
+ await queryRunner.query("UPDATE messages SET flags = COALESCE(flags_old, 0);");
+ await queryRunner.query("ALTER TABLE messages DROP COLUMN flags_old;");
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE messages RENAME COLUMN flags TO flags_new;");
- await queryRunner.query("ALTER TABLE messages ADD COLUMN flags integer;");
- await queryRunner.query("UPDATE messages SET flags = flags_new;");
- await queryRunner.query("ALTER TABLE messages DROP COLUMN flags_new;");
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE messages RENAME COLUMN flags TO flags_new;");
+ await queryRunner.query("ALTER TABLE messages ADD COLUMN flags integer;");
+ await queryRunner.query("UPDATE messages SET flags = flags_new;");
+ await queryRunner.query("ALTER TABLE messages DROP COLUMN flags_new;");
+ }
}
diff --git a/src/util/migration/postgres/1719776735000-newUserSettings.ts b/src/util/migration/postgres/1719776735000-newUserSettings.ts
index d4142d27..cd73037c 100644
--- a/src/util/migration/postgres/1719776735000-newUserSettings.ts
+++ b/src/util/migration/postgres/1719776735000-newUserSettings.ts
@@ -1,15 +1,15 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class NewUserSettings1719776735000 implements MigrationInterface {
- name = "NewUserSettings1719776735000";
+ name = "NewUserSettings1719776735000";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE user_settings ADD COLUMN friend_discovery_flags integer DEFAULT 0;");
- await queryRunner.query("ALTER TABLE user_settings ADD COLUMN view_nsfw_guilds boolean DEFAULT true;");
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE user_settings ADD COLUMN friend_discovery_flags integer DEFAULT 0;");
+ await queryRunner.query("ALTER TABLE user_settings ADD COLUMN view_nsfw_guilds boolean DEFAULT true;");
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE user_settings DROP COLUMN friend_discovery_flags;");
- await queryRunner.query("ALTER TABLE user_settings DROP COLUMN view_nsfw_guilds;");
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE user_settings DROP COLUMN friend_discovery_flags;");
+ await queryRunner.query("ALTER TABLE user_settings DROP COLUMN view_nsfw_guilds;");
+ }
}
diff --git a/src/util/migration/postgres/1720157926878-messagePollObject.ts b/src/util/migration/postgres/1720157926878-messagePollObject.ts
index 7c3c95a0..bd21c6e5 100644
--- a/src/util/migration/postgres/1720157926878-messagePollObject.ts
+++ b/src/util/migration/postgres/1720157926878-messagePollObject.ts
@@ -1,13 +1,13 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class MessagePollObject1720157926878 implements MigrationInterface {
- name = "MessagePollObject1720157926878";
+ name = "MessagePollObject1720157926878";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE messages ADD poll text NULL");
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE messages ADD poll text NULL");
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE messages DROP COLUMN poll");
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE messages DROP COLUMN poll");
+ }
}
diff --git a/src/util/migration/postgres/1720628601997-badges.ts b/src/util/migration/postgres/1720628601997-badges.ts
index 0cecb6ea..7fe1e19f 100644
--- a/src/util/migration/postgres/1720628601997-badges.ts
+++ b/src/util/migration/postgres/1720628601997-badges.ts
@@ -1,17 +1,17 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class Badges1720628601997 implements MigrationInterface {
- name = "Badges1720628601997";
+ name = "Badges1720628601997";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(
- `CREATE TABLE "badges" ("id" character varying NOT NULL, "description" character varying NOT NULL, "icon" character varying NOT NULL, "link" character varying, CONSTRAINT "PK_8a651318b8de577e8e217676466" PRIMARY KEY ("id"))`,
- );
- await queryRunner.query(`ALTER TABLE "users" ADD "badge_ids" text`);
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ `CREATE TABLE "badges" ("id" character varying NOT NULL, "description" character varying NOT NULL, "icon" character varying NOT NULL, "link" character varying, CONSTRAINT "PK_8a651318b8de577e8e217676466" PRIMARY KEY ("id"))`,
+ );
+ await queryRunner.query(`ALTER TABLE "users" ADD "badge_ids" text`);
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "users" DROP COLUMN "badge_ids"`);
- await queryRunner.query(`DROP TABLE "badges"`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "users" DROP COLUMN "badge_ids"`);
+ await queryRunner.query(`DROP TABLE "badges"`);
+ }
}
diff --git a/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts b/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts
index 46c507d4..3576e4ac 100644
--- a/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts
+++ b/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts
@@ -1,15 +1,15 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class WebhookMessageProperties1721298824927 implements MigrationInterface {
- name = "WebhookMessageProperties1721298824927";
+ name = "WebhookMessageProperties1721298824927";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE messages ADD username text NULL");
- await queryRunner.query("ALTER TABLE messages ADD avatar text NULL");
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE messages ADD username text NULL");
+ await queryRunner.query("ALTER TABLE messages ADD avatar text NULL");
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE messages DROP COLUMN username");
- await queryRunner.query("ALTER TABLE messages DROP COLUMN avatar");
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE messages DROP COLUMN username");
+ await queryRunner.query("ALTER TABLE messages DROP COLUMN avatar");
+ }
}
diff --git a/src/util/migration/postgres/1723347738541-client_status.ts b/src/util/migration/postgres/1723347738541-client_status.ts
index c16e0490..941e6d76 100644
--- a/src/util/migration/postgres/1723347738541-client_status.ts
+++ b/src/util/migration/postgres/1723347738541-client_status.ts
@@ -1,13 +1,13 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class client_status1723347738541 implements MigrationInterface {
- name = "client_status1723347738541";
+ name = "client_status1723347738541";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE sessions ADD client_status text NULL");
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE sessions ADD client_status text NULL");
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE sessions DROP COLUMN client_status");
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE sessions DROP COLUMN client_status");
+ }
}
diff --git a/src/util/migration/postgres/1723577874393-discoveryCategoryIcon.ts b/src/util/migration/postgres/1723577874393-discoveryCategoryIcon.ts
index 29b4138a..8dfde3cb 100644
--- a/src/util/migration/postgres/1723577874393-discoveryCategoryIcon.ts
+++ b/src/util/migration/postgres/1723577874393-discoveryCategoryIcon.ts
@@ -1,13 +1,13 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class DiscoveryCategoryIcon1723577874393 implements MigrationInterface {
- name = "DiscoveryCategoryIcon1723577874393";
+ name = "DiscoveryCategoryIcon1723577874393";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE categories ADD icon text NULL");
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE categories ADD icon text NULL");
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE categories DROP COLUMN icon");
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE categories DROP COLUMN icon");
+ }
}
diff --git a/src/util/migration/postgres/1723644478176-webhookSourceChannel.ts b/src/util/migration/postgres/1723644478176-webhookSourceChannel.ts
index 12a726ff..00fe413f 100644
--- a/src/util/migration/postgres/1723644478176-webhookSourceChannel.ts
+++ b/src/util/migration/postgres/1723644478176-webhookSourceChannel.ts
@@ -1,17 +1,17 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class WebhookSourceChannel1723644478176 implements MigrationInterface {
- name = "WebhookSourceChannel1723644478176";
+ name = "WebhookSourceChannel1723644478176";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE webhooks ADD COLUMN source_channel_id VARCHAR(255) NULL DEFAULT NULL");
- await queryRunner.query(
- "ALTER TABLE webhooks ADD CONSTRAINT FK_d64f38834fa676f6caa4786ddd6 FOREIGN KEY (source_channel_id) REFERENCES channels (id) ON UPDATE NO ACTION ON DELETE CASCADE",
- );
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE webhooks ADD COLUMN source_channel_id VARCHAR(255) NULL DEFAULT NULL");
+ await queryRunner.query(
+ "ALTER TABLE webhooks ADD CONSTRAINT FK_d64f38834fa676f6caa4786ddd6 FOREIGN KEY (source_channel_id) REFERENCES channels (id) ON UPDATE NO ACTION ON DELETE CASCADE",
+ );
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE webhooks DROP CONSTRAINT FK_d64f38834fa676f6caa4786ddd6");
- await queryRunner.query("ALTER TABLE webhooks DROP COLUMN source_channel_id");
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE webhooks DROP CONSTRAINT FK_d64f38834fa676f6caa4786ddd6");
+ await queryRunner.query("ALTER TABLE webhooks DROP COLUMN source_channel_id");
+ }
}
diff --git a/src/util/migration/postgres/1724477620293-teamMemberRole.ts b/src/util/migration/postgres/1724477620293-teamMemberRole.ts
index 9bc92cb7..043a1ddc 100644
--- a/src/util/migration/postgres/1724477620293-teamMemberRole.ts
+++ b/src/util/migration/postgres/1724477620293-teamMemberRole.ts
@@ -1,13 +1,13 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class TeamMemberRole1724477620293 implements MigrationInterface {
- name = "TeamMemberRole1724477620293";
+ name = "TeamMemberRole1724477620293";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE team_members ADD COLUMN role text NOT NULL");
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE team_members ADD COLUMN role text NOT NULL");
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE team_members DROP COLUMN role");
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE team_members DROP COLUMN role");
+ }
}
diff --git a/src/util/migration/postgres/1725090962922-applicationProperties.ts b/src/util/migration/postgres/1725090962922-applicationProperties.ts
index e3960148..03fb172f 100644
--- a/src/util/migration/postgres/1725090962922-applicationProperties.ts
+++ b/src/util/migration/postgres/1725090962922-applicationProperties.ts
@@ -1,15 +1,15 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class ApplicationProperties1725090962922 implements MigrationInterface {
- name = "ApplicationProperties1725090962922";
+ name = "ApplicationProperties1725090962922";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE applications ADD COLUMN guild_id TEXT NULL DEFAULT NULL");
- await queryRunner.query("ALTER TABLE applications ADD COLUMN custom_install_url TEXT NULL DEFAULT NULL");
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE applications ADD COLUMN guild_id TEXT NULL DEFAULT NULL");
+ await queryRunner.query("ALTER TABLE applications ADD COLUMN custom_install_url TEXT NULL DEFAULT NULL");
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query("ALTER TABLE applications DROP COLUMN guild_id");
- await queryRunner.query("ALTER TABLE applications DROP COLUMN custom_install_url");
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query("ALTER TABLE applications DROP COLUMN guild_id");
+ await queryRunner.query("ALTER TABLE applications DROP COLUMN custom_install_url");
+ }
}
diff --git a/src/util/migration/postgres/1745625724865-voice.ts b/src/util/migration/postgres/1745625724865-voice.ts
index 2310ec20..0e110dda 100644
--- a/src/util/migration/postgres/1745625724865-voice.ts
+++ b/src/util/migration/postgres/1745625724865-voice.ts
@@ -1,35 +1,35 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class Voice1745625724865 implements MigrationInterface {
- name = "Voice1745625724865";
+ name = "Voice1745625724865";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(
- `CREATE TABLE "streams" ("id" character varying NOT NULL, "owner_id" character varying NOT NULL, "channel_id" character varying NOT NULL, "endpoint" character varying NOT NULL, CONSTRAINT "PK_40440b6f569ebc02bc71c25c499" PRIMARY KEY ("id"))`,
- );
- await queryRunner.query(
- `CREATE TABLE "stream_sessions" ("id" character varying NOT NULL, "stream_id" character varying NOT NULL, "user_id" character varying NOT NULL, "token" character varying, "session_id" character varying NOT NULL, "used" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_49bdc3f66394c12478f8371c546" PRIMARY KEY ("id"))`,
- );
- await queryRunner.query(
- `ALTER TABLE "streams" ADD CONSTRAINT "FK_1b566f9b54d1cda271da53ac82f" FOREIGN KEY ("owner_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
- );
- await queryRunner.query(
- `ALTER TABLE "streams" ADD CONSTRAINT "FK_5101f0cded27ff0aae78fc4eed7" FOREIGN KEY ("channel_id") REFERENCES "channels"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
- );
- await queryRunner.query(
- `ALTER TABLE "stream_sessions" ADD CONSTRAINT "FK_8b5a028a34dae9ee54af37c9c32" FOREIGN KEY ("stream_id") REFERENCES "streams"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
- );
- await queryRunner.query(
- `ALTER TABLE "stream_sessions" ADD CONSTRAINT "FK_13ae5c29aff4d0890c54179511a" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
- );
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ `CREATE TABLE "streams" ("id" character varying NOT NULL, "owner_id" character varying NOT NULL, "channel_id" character varying NOT NULL, "endpoint" character varying NOT NULL, CONSTRAINT "PK_40440b6f569ebc02bc71c25c499" PRIMARY KEY ("id"))`,
+ );
+ await queryRunner.query(
+ `CREATE TABLE "stream_sessions" ("id" character varying NOT NULL, "stream_id" character varying NOT NULL, "user_id" character varying NOT NULL, "token" character varying, "session_id" character varying NOT NULL, "used" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_49bdc3f66394c12478f8371c546" PRIMARY KEY ("id"))`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "streams" ADD CONSTRAINT "FK_1b566f9b54d1cda271da53ac82f" FOREIGN KEY ("owner_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "streams" ADD CONSTRAINT "FK_5101f0cded27ff0aae78fc4eed7" FOREIGN KEY ("channel_id") REFERENCES "channels"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "stream_sessions" ADD CONSTRAINT "FK_8b5a028a34dae9ee54af37c9c32" FOREIGN KEY ("stream_id") REFERENCES "streams"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "stream_sessions" ADD CONSTRAINT "FK_13ae5c29aff4d0890c54179511a" 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 "stream_sessions" DROP CONSTRAINT "FK_13ae5c29aff4d0890c54179511a"`);
- await queryRunner.query(`ALTER TABLE "stream_sessions" DROP CONSTRAINT "FK_8b5a028a34dae9ee54af37c9c32"`);
- await queryRunner.query(`ALTER TABLE "streams" DROP CONSTRAINT "FK_5101f0cded27ff0aae78fc4eed7"`);
- await queryRunner.query(`ALTER TABLE "streams" DROP CONSTRAINT "FK_1b566f9b54d1cda271da53ac82f"`);
- await queryRunner.query(`DROP TABLE "stream_sessions"`);
- await queryRunner.query(`DROP TABLE "streams"`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "stream_sessions" DROP CONSTRAINT "FK_13ae5c29aff4d0890c54179511a"`);
+ await queryRunner.query(`ALTER TABLE "stream_sessions" DROP CONSTRAINT "FK_8b5a028a34dae9ee54af37c9c32"`);
+ await queryRunner.query(`ALTER TABLE "streams" DROP CONSTRAINT "FK_5101f0cded27ff0aae78fc4eed7"`);
+ await queryRunner.query(`ALTER TABLE "streams" DROP CONSTRAINT "FK_1b566f9b54d1cda271da53ac82f"`);
+ await queryRunner.query(`DROP TABLE "stream_sessions"`);
+ await queryRunner.query(`DROP TABLE "streams"`);
+ }
}
diff --git a/src/util/migration/postgres/1752157979333-UserSettingsProtos.ts b/src/util/migration/postgres/1752157979333-UserSettingsProtos.ts
index d7cf546d..7a243818 100644
--- a/src/util/migration/postgres/1752157979333-UserSettingsProtos.ts
+++ b/src/util/migration/postgres/1752157979333-UserSettingsProtos.ts
@@ -1,20 +1,20 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UserSettingsProtos1752157979333 implements MigrationInterface {
- name = "UserSettingsProtos1752157979333";
+ name = "UserSettingsProtos1752157979333";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`DROP TABLE IF EXISTS "user_settings_protos"`);
- await queryRunner.query(
- `CREATE TABLE "user_settings_protos" ("user_id" character varying NOT NULL, "userSettings" text, "frecencySettings" text, CONSTRAINT "PK_8ff3d1961a48b693810c9f99853" PRIMARY KEY ("user_id"))`,
- );
- await queryRunner.query(
- `ALTER TABLE "user_settings_protos" ADD CONSTRAINT "FK_8ff3d1961a48b693810c9f99853" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
- );
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`DROP TABLE IF EXISTS "user_settings_protos"`);
+ await queryRunner.query(
+ `CREATE TABLE "user_settings_protos" ("user_id" character varying NOT NULL, "userSettings" text, "frecencySettings" text, CONSTRAINT "PK_8ff3d1961a48b693810c9f99853" PRIMARY KEY ("user_id"))`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "user_settings_protos" ADD CONSTRAINT "FK_8ff3d1961a48b693810c9f99853" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
+ );
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "user_settings_protos" DROP CONSTRAINT "FK_8ff3d1961a48b693810c9f99853"`);
- await queryRunner.query(`DROP TABLE "user_settings_protos"`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "user_settings_protos" DROP CONSTRAINT "FK_8ff3d1961a48b693810c9f99853"`);
+ await queryRunner.query(`DROP TABLE "user_settings_protos"`);
+ }
}
diff --git a/src/util/migration/postgres/1752321571508-RoleColors.ts b/src/util/migration/postgres/1752321571508-RoleColors.ts
index c88476ea..0a1cbc9b 100644
--- a/src/util/migration/postgres/1752321571508-RoleColors.ts
+++ b/src/util/migration/postgres/1752321571508-RoleColors.ts
@@ -1,15 +1,15 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class RoleColors1752321571508 implements MigrationInterface {
- name = "RoleColors1752321571508";
+ name = "RoleColors1752321571508";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "roles" ADD "colors" text`);
- await queryRunner.query(`UPDATE "roles" SET "colors" = jsonb_build_object('primary_color', "color") WHERE "colors" IS NULL`);
- await queryRunner.query(`ALTER TABLE "roles" ALTER COLUMN "colors" SET NOT NULL`);
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "roles" ADD "colors" text`);
+ await queryRunner.query(`UPDATE "roles" SET "colors" = jsonb_build_object('primary_color', "color") WHERE "colors" IS NULL`);
+ await queryRunner.query(`ALTER TABLE "roles" ALTER COLUMN "colors" SET NOT NULL`);
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "roles" DROP COLUMN "colors"`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "roles" DROP COLUMN "colors"`);
+ }
}
diff --git a/src/util/migration/postgres/1752383879533-message_pinned_at.ts b/src/util/migration/postgres/1752383879533-message_pinned_at.ts
index b5174776..f80b0a0b 100644
--- a/src/util/migration/postgres/1752383879533-message_pinned_at.ts
+++ b/src/util/migration/postgres/1752383879533-message_pinned_at.ts
@@ -1,17 +1,17 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class MessagePinnedAt1752383879533 implements MigrationInterface {
- name = "MessagePinnedAt1752383879533";
+ name = "MessagePinnedAt1752383879533";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "messages" ADD "pinned_at" TIMESTAMP`);
- await queryRunner.query(`UPDATE "messages" SET "pinned_at" = NOW() WHERE "pinned" = true`);
- await queryRunner.query(`ALTER TABLE "messages" DROP COLUMN "pinned"`);
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "messages" ADD "pinned_at" TIMESTAMP`);
+ await queryRunner.query(`UPDATE "messages" SET "pinned_at" = NOW() WHERE "pinned" = true`);
+ await queryRunner.query(`ALTER TABLE "messages" DROP COLUMN "pinned"`);
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "messages" ADD "pinned" boolean`);
- await queryRunner.query(`UPDATE "messages" SET "pinned" = true WHERE "pinned_at" IS NOT NULL`);
- await queryRunner.query(`ALTER TABLE "messages" DROP COLUMN "pinned_at"`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "messages" ADD "pinned" boolean`);
+ await queryRunner.query(`UPDATE "messages" SET "pinned" = true WHERE "pinned_at" IS NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "messages" DROP COLUMN "pinned_at"`);
+ }
}
diff --git a/src/util/migration/postgres/1753639700904-Automod.ts b/src/util/migration/postgres/1753639700904-Automod.ts
index 2df78ccd..083edd3a 100644
--- a/src/util/migration/postgres/1753639700904-Automod.ts
+++ b/src/util/migration/postgres/1753639700904-Automod.ts
@@ -1,19 +1,19 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class Automod1753639700904 implements MigrationInterface {
- name = "Automod1753639700904";
+ name = "Automod1753639700904";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(
- `CREATE TABLE "automod_rules" ("id" character varying NOT NULL, "enabled" boolean NOT NULL, "event_type" integer NOT NULL, "exempt_channels" text NOT NULL, "exempt_roles" text NOT NULL, "guild_id" character varying NOT NULL, "name" character varying NOT NULL, "position" integer NOT NULL, "trigger_type" integer NOT NULL, "trigger_metadata" text, "actions" text NOT NULL, "creator_id" character varying, CONSTRAINT "PK_99789ae863507f5aed9e58d7866" PRIMARY KEY ("id"))`,
- );
- await queryRunner.query(
- `ALTER TABLE "automod_rules" ADD CONSTRAINT "FK_12d3d60b961393d310429c062b7" FOREIGN KEY ("creator_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
- );
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ `CREATE TABLE "automod_rules" ("id" character varying NOT NULL, "enabled" boolean NOT NULL, "event_type" integer NOT NULL, "exempt_channels" text NOT NULL, "exempt_roles" text NOT NULL, "guild_id" character varying NOT NULL, "name" character varying NOT NULL, "position" integer NOT NULL, "trigger_type" integer NOT NULL, "trigger_metadata" text, "actions" text NOT NULL, "creator_id" character varying, CONSTRAINT "PK_99789ae863507f5aed9e58d7866" PRIMARY KEY ("id"))`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "automod_rules" ADD CONSTRAINT "FK_12d3d60b961393d310429c062b7" FOREIGN KEY ("creator_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
+ );
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "automod_rules" DROP CONSTRAINT "FK_12d3d60b961393d310429c062b7"`);
- await queryRunner.query(`DROP TABLE "automod_rules"`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "automod_rules" DROP CONSTRAINT "FK_12d3d60b961393d310429c062b7"`);
+ await queryRunner.query(`DROP TABLE "automod_rules"`);
+ }
}
diff --git a/src/util/migration/postgres/1758654246197-CloudAttachments.ts b/src/util/migration/postgres/1758654246197-CloudAttachments.ts
index 6e462e0b..86894f1d 100644
--- a/src/util/migration/postgres/1758654246197-CloudAttachments.ts
+++ b/src/util/migration/postgres/1758654246197-CloudAttachments.ts
@@ -1,23 +1,23 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class CloudAttachments1758654246197 implements MigrationInterface {
- name = "CloudAttachments1758654246197";
+ name = "CloudAttachments1758654246197";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(
- `CREATE TABLE "cloud_attachments" ("id" character varying NOT NULL, "user_id" character varying, "channel_id" character varying, "upload_filename" character varying NOT NULL, "user_attachment_id" character varying, "user_filename" character varying NOT NULL, "user_file_size" integer, "user_original_content_type" character varying, "user_is_clip" boolean, "size" integer, "height" integer, "width" integer, "content_type" character varying, "userId" character varying, "channelId" character varying, CONSTRAINT "PK_5794827a3ee7c9318612dcb70c8" PRIMARY KEY ("id"))`,
- );
- await queryRunner.query(
- `ALTER TABLE "cloud_attachments" ADD CONSTRAINT "FK_e6b32df2004e8ad0f488b4a2019" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
- );
- await queryRunner.query(
- `ALTER TABLE "cloud_attachments" ADD CONSTRAINT "FK_cab965a18f8ca30293bff3d50a8" FOREIGN KEY ("channelId") REFERENCES "channels"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
- );
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ `CREATE TABLE "cloud_attachments" ("id" character varying NOT NULL, "user_id" character varying, "channel_id" character varying, "upload_filename" character varying NOT NULL, "user_attachment_id" character varying, "user_filename" character varying NOT NULL, "user_file_size" integer, "user_original_content_type" character varying, "user_is_clip" boolean, "size" integer, "height" integer, "width" integer, "content_type" character varying, "userId" character varying, "channelId" character varying, CONSTRAINT "PK_5794827a3ee7c9318612dcb70c8" PRIMARY KEY ("id"))`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "cloud_attachments" ADD CONSTRAINT "FK_e6b32df2004e8ad0f488b4a2019" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "cloud_attachments" ADD CONSTRAINT "FK_cab965a18f8ca30293bff3d50a8" FOREIGN KEY ("channelId") REFERENCES "channels"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
+ );
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP CONSTRAINT "FK_cab965a18f8ca30293bff3d50a8"`);
- await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP CONSTRAINT "FK_e6b32df2004e8ad0f488b4a2019"`);
- await queryRunner.query(`DROP TABLE "cloud_attachments"`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP CONSTRAINT "FK_cab965a18f8ca30293bff3d50a8"`);
+ await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP CONSTRAINT "FK_e6b32df2004e8ad0f488b4a2019"`);
+ await queryRunner.query(`DROP TABLE "cloud_attachments"`);
+ }
}
diff --git a/src/util/migration/postgres/1758654621365-CloudAttachmentsFixIdRefs.ts b/src/util/migration/postgres/1758654621365-CloudAttachmentsFixIdRefs.ts
index 6ad63000..dcd1b77c 100644
--- a/src/util/migration/postgres/1758654621365-CloudAttachmentsFixIdRefs.ts
+++ b/src/util/migration/postgres/1758654621365-CloudAttachmentsFixIdRefs.ts
@@ -1,31 +1,31 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class CloudAttachmentsFixIdRefs1758654621365 implements MigrationInterface {
- name = "CloudAttachmentsFixIdRefs1758654621365";
+ name = "CloudAttachmentsFixIdRefs1758654621365";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP CONSTRAINT "FK_cab965a18f8ca30293bff3d50a8"`);
- await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP CONSTRAINT "FK_e6b32df2004e8ad0f488b4a2019"`);
- await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP COLUMN "channelId"`);
- await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP COLUMN "userId"`);
- await queryRunner.query(
- `ALTER TABLE "cloud_attachments" ADD CONSTRAINT "FK_8bf8cc8767e48cb482ff644fce6" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
- );
- await queryRunner.query(
- `ALTER TABLE "cloud_attachments" ADD CONSTRAINT "FK_998d5fe91008ba5b09e1322104c" FOREIGN KEY ("channel_id") REFERENCES "channels"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
- );
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP CONSTRAINT "FK_cab965a18f8ca30293bff3d50a8"`);
+ await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP CONSTRAINT "FK_e6b32df2004e8ad0f488b4a2019"`);
+ await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP COLUMN "channelId"`);
+ await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP COLUMN "userId"`);
+ await queryRunner.query(
+ `ALTER TABLE "cloud_attachments" ADD CONSTRAINT "FK_8bf8cc8767e48cb482ff644fce6" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "cloud_attachments" ADD CONSTRAINT "FK_998d5fe91008ba5b09e1322104c" FOREIGN KEY ("channel_id") REFERENCES "channels"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
+ );
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP CONSTRAINT "FK_998d5fe91008ba5b09e1322104c"`);
- await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP CONSTRAINT "FK_8bf8cc8767e48cb482ff644fce6"`);
- await queryRunner.query(`ALTER TABLE "cloud_attachments" ADD "userId" character varying`);
- await queryRunner.query(`ALTER TABLE "cloud_attachments" ADD "channelId" character varying`);
- await queryRunner.query(
- `ALTER TABLE "cloud_attachments" ADD CONSTRAINT "FK_e6b32df2004e8ad0f488b4a2019" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
- );
- await queryRunner.query(
- `ALTER TABLE "cloud_attachments" ADD CONSTRAINT "FK_cab965a18f8ca30293bff3d50a8" FOREIGN KEY ("channelId") REFERENCES "channels"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
- );
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP CONSTRAINT "FK_998d5fe91008ba5b09e1322104c"`);
+ await queryRunner.query(`ALTER TABLE "cloud_attachments" DROP CONSTRAINT "FK_8bf8cc8767e48cb482ff644fce6"`);
+ await queryRunner.query(`ALTER TABLE "cloud_attachments" ADD "userId" character varying`);
+ await queryRunner.query(`ALTER TABLE "cloud_attachments" ADD "channelId" character varying`);
+ await queryRunner.query(
+ `ALTER TABLE "cloud_attachments" ADD CONSTRAINT "FK_e6b32df2004e8ad0f488b4a2019" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "cloud_attachments" ADD CONSTRAINT "FK_cab965a18f8ca30293bff3d50a8" FOREIGN KEY ("channelId") REFERENCES "channels"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
+ );
+ }
}
diff --git a/src/util/migration/postgres/1760622755598-ApplicationCommands.ts b/src/util/migration/postgres/1760622755598-ApplicationCommands.ts
index e40a3a1e..6d4aebc5 100644
--- a/src/util/migration/postgres/1760622755598-ApplicationCommands.ts
+++ b/src/util/migration/postgres/1760622755598-ApplicationCommands.ts
@@ -1,15 +1,15 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class ApplicationCommands1760622755598 implements MigrationInterface {
- name = "ApplicationCommands1760622755598";
+ name = "ApplicationCommands1760622755598";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(
- `CREATE TABLE "application_commands" ("id" character varying NOT NULL, "type" integer NOT NULL DEFAULT '1', "application_id" character varying NOT NULL, "guild_id" character varying, "name" character varying NOT NULL, "name_localizations" text, "description" character varying NOT NULL, "description_localizations" text, "options" text, "default_member_permissions" character varying, "dm_permission" boolean NOT NULL DEFAULT true, "permissions" text, "nsfw" boolean NOT NULL DEFAULT false, "integration_types" text, "global_popularity_rank" integer NOT NULL DEFAULT '0', "contexts" text, "version" character varying NOT NULL DEFAULT '0', "handler" integer NOT NULL DEFAULT '0', CONSTRAINT "PK_0f73c2f025989c407947e1f75fe" PRIMARY KEY ("id"))`,
- );
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ `CREATE TABLE "application_commands" ("id" character varying NOT NULL, "type" integer NOT NULL DEFAULT '1', "application_id" character varying NOT NULL, "guild_id" character varying, "name" character varying NOT NULL, "name_localizations" text, "description" character varying NOT NULL, "description_localizations" text, "options" text, "default_member_permissions" character varying, "dm_permission" boolean NOT NULL DEFAULT true, "permissions" text, "nsfw" boolean NOT NULL DEFAULT false, "integration_types" text, "global_popularity_rank" integer NOT NULL DEFAULT '0', "contexts" text, "version" character varying NOT NULL DEFAULT '0', "handler" integer NOT NULL DEFAULT '0', CONSTRAINT "PK_0f73c2f025989c407947e1f75fe" PRIMARY KEY ("id"))`,
+ );
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`DROP TABLE "application_commands"`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`DROP TABLE "application_commands"`);
+ }
}
diff --git a/src/util/migration/postgres/1760622755599-ReconcileMigrationAttempts.ts b/src/util/migration/postgres/1760622755599-ReconcileMigrationAttempts.ts
index 27a20278..fefd5473 100644
--- a/src/util/migration/postgres/1760622755599-ReconcileMigrationAttempts.ts
+++ b/src/util/migration/postgres/1760622755599-ReconcileMigrationAttempts.ts
@@ -1,57 +1,57 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class ReconcileMigrationAttempts1760622755598 implements MigrationInterface {
- name = "ReconcileMigrationAttempts1760622755598";
+ name = "ReconcileMigrationAttempts1760622755598";
- public async up(queryRunner: QueryRunner): Promise<void> {
- // doesnt work because initial setup is syncDb()
- //await queryRunner.query(`ALTER TABLE "webhooks" DROP CONSTRAINT "fk_d64f38834fa676f6caa4786ddd6"`);
- await queryRunner.query(`ALTER TABLE "webhooks" ALTER COLUMN "source_channel_id" TYPE character varying`);
- await queryRunner.query(`ALTER TABLE "messages" ALTER COLUMN "username" TYPE character varying`);
- await queryRunner.query(`ALTER TABLE "messages" ALTER COLUMN "avatar" TYPE character varying`);
- await queryRunner.query(`ALTER TABLE "channels" ALTER COLUMN "default_thread_rate_limit_per_user" DROP NOT NULL`);
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "client_status" SET NOT NULL`);
- await queryRunner.query(`ALTER TABLE "user_settings" ALTER COLUMN "friend_discovery_flags" DROP DEFAULT`);
- await queryRunner.query(`ALTER TABLE "user_settings" ALTER COLUMN "view_nsfw_guilds" DROP DEFAULT`);
- await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "flags" SET NOT NULL`);
- await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "public_flags" SET NOT NULL`);
- await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "purchased_flags" SET NOT NULL`);
- await queryRunner.query(`ALTER TABLE "team_members" ALTER COLUMN "role" TYPE character varying`);
- await queryRunner.query(`ALTER TABLE "team_members" ALTER COLUMN "role" SET NOT NULL`);
- await queryRunner.query(`ALTER TABLE "applications" ALTER COLUMN "guild_id" TYPE character varying`);
- await queryRunner.query(`ALTER TABLE "applications" ALTER COLUMN "custom_install_url" TYPE character varying`);
- await queryRunner.query(`ALTER TABLE "categories" ALTER COLUMN "icon" TYPE character varying`);
- await queryRunner.query(`ALTER TABLE "user_settings_protos" ALTER COLUMN "userSettings" TYPE character varying`);
- await queryRunner.query(`ALTER TABLE "user_settings_protos" ALTER COLUMN "frecencySettings" TYPE character varying`);
- await queryRunner.query(
- `ALTER TABLE "webhooks" ADD CONSTRAINT "FK_4495b7032a33c6b8b605d030398" FOREIGN KEY ("source_channel_id") REFERENCES "channels"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
- );
- await queryRunner.query(
- `ALTER TABLE "applications" ADD CONSTRAINT "FK_e5bf78cdbbe9ba91062d74c5aba" FOREIGN KEY ("guild_id") REFERENCES "guilds"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
- );
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ // doesnt work because initial setup is syncDb()
+ //await queryRunner.query(`ALTER TABLE "webhooks" DROP CONSTRAINT "fk_d64f38834fa676f6caa4786ddd6"`);
+ await queryRunner.query(`ALTER TABLE "webhooks" ALTER COLUMN "source_channel_id" TYPE character varying`);
+ await queryRunner.query(`ALTER TABLE "messages" ALTER COLUMN "username" TYPE character varying`);
+ await queryRunner.query(`ALTER TABLE "messages" ALTER COLUMN "avatar" TYPE character varying`);
+ await queryRunner.query(`ALTER TABLE "channels" ALTER COLUMN "default_thread_rate_limit_per_user" DROP NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "client_status" SET NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "user_settings" ALTER COLUMN "friend_discovery_flags" DROP DEFAULT`);
+ await queryRunner.query(`ALTER TABLE "user_settings" ALTER COLUMN "view_nsfw_guilds" DROP DEFAULT`);
+ await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "flags" SET NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "public_flags" SET NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "purchased_flags" SET NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "team_members" ALTER COLUMN "role" TYPE character varying`);
+ await queryRunner.query(`ALTER TABLE "team_members" ALTER COLUMN "role" SET NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "applications" ALTER COLUMN "guild_id" TYPE character varying`);
+ await queryRunner.query(`ALTER TABLE "applications" ALTER COLUMN "custom_install_url" TYPE character varying`);
+ await queryRunner.query(`ALTER TABLE "categories" ALTER COLUMN "icon" TYPE character varying`);
+ await queryRunner.query(`ALTER TABLE "user_settings_protos" ALTER COLUMN "userSettings" TYPE character varying`);
+ await queryRunner.query(`ALTER TABLE "user_settings_protos" ALTER COLUMN "frecencySettings" TYPE character varying`);
+ await queryRunner.query(
+ `ALTER TABLE "webhooks" ADD CONSTRAINT "FK_4495b7032a33c6b8b605d030398" FOREIGN KEY ("source_channel_id") REFERENCES "channels"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "applications" ADD CONSTRAINT "FK_e5bf78cdbbe9ba91062d74c5aba" FOREIGN KEY ("guild_id") REFERENCES "guilds"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
+ );
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "applications" DROP CONSTRAINT "FK_e5bf78cdbbe9ba91062d74c5aba"`);
- await queryRunner.query(`ALTER TABLE "webhooks" DROP CONSTRAINT "FK_4495b7032a33c6b8b605d030398"`);
- await queryRunner.query(`ALTER TABLE "user_settings_protos" ALTER COLUMN "frecencySettings" TYPE text`);
- await queryRunner.query(`ALTER TABLE "user_settings_protos" ALTER COLUMN "userSettings" TYPE text`);
- await queryRunner.query(`ALTER TABLE "categories" ALTER COLUMN "icon" TYPE text`);
- await queryRunner.query(`ALTER TABLE "applications" ALTER COLUMN "custom_install_url" TYPE text`);
- await queryRunner.query(`ALTER TABLE "applications" ALTER COLUMN "guild_id" TYPE text`);
- await queryRunner.query(`ALTER TABLE "team_members" ALTER COLUMN "role" TYPE text`);
- await queryRunner.query(`ALTER TABLE "team_members" ALTER COLUMN "role" SET NOT NULL`);
- await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "purchased_flags" SET NOT NULL`);
- await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "public_flags" SET NOT NULL`);
- await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "flags" SET NOT NULL`);
- await queryRunner.query(`ALTER TABLE "user_settings" ALTER COLUMN "view_nsfw_guilds" SET DEFAULT true`);
- await queryRunner.query(`ALTER TABLE "user_settings" ALTER COLUMN "friend_discovery_flags" SET DEFAULT '0'`);
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "client_status" DROP NOT NULL`);
- await queryRunner.query(`ALTER TABLE "channels" ALTER COLUMN "default_thread_rate_limit_per_user" SET NOT NULL`);
- await queryRunner.query(`ALTER TABLE "messages" ALTER COLUMN "avatar" TYPE text`);
- await queryRunner.query(`ALTER TABLE "messages" ALTER COLUMN "username" TYPE text`);
- await queryRunner.query(`ALTER TABLE "webhooks" ALTER COLUMN "source_channel_id" TYPE character varying(255)`);
- await queryRunner.query(`ALTER TABLE "webhooks" ALTER COLUMN "source_channel_id" SET DEFAULT NULL`);
- // await queryRunner.query(`ALTER TABLE "webhooks" ADD CONSTRAINT "fk_d64f38834fa676f6caa4786ddd6" FOREIGN KEY ("source_channel_id") REFERENCES "channels"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "applications" DROP CONSTRAINT "FK_e5bf78cdbbe9ba91062d74c5aba"`);
+ await queryRunner.query(`ALTER TABLE "webhooks" DROP CONSTRAINT "FK_4495b7032a33c6b8b605d030398"`);
+ await queryRunner.query(`ALTER TABLE "user_settings_protos" ALTER COLUMN "frecencySettings" TYPE text`);
+ await queryRunner.query(`ALTER TABLE "user_settings_protos" ALTER COLUMN "userSettings" TYPE text`);
+ await queryRunner.query(`ALTER TABLE "categories" ALTER COLUMN "icon" TYPE text`);
+ await queryRunner.query(`ALTER TABLE "applications" ALTER COLUMN "custom_install_url" TYPE text`);
+ await queryRunner.query(`ALTER TABLE "applications" ALTER COLUMN "guild_id" TYPE text`);
+ await queryRunner.query(`ALTER TABLE "team_members" ALTER COLUMN "role" TYPE text`);
+ await queryRunner.query(`ALTER TABLE "team_members" ALTER COLUMN "role" SET NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "purchased_flags" SET NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "public_flags" SET NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "flags" SET NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "user_settings" ALTER COLUMN "view_nsfw_guilds" SET DEFAULT true`);
+ await queryRunner.query(`ALTER TABLE "user_settings" ALTER COLUMN "friend_discovery_flags" SET DEFAULT '0'`);
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "client_status" DROP NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "channels" ALTER COLUMN "default_thread_rate_limit_per_user" SET NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "messages" ALTER COLUMN "avatar" TYPE text`);
+ await queryRunner.query(`ALTER TABLE "messages" ALTER COLUMN "username" TYPE text`);
+ await queryRunner.query(`ALTER TABLE "webhooks" ALTER COLUMN "source_channel_id" TYPE character varying(255)`);
+ await queryRunner.query(`ALTER TABLE "webhooks" ALTER COLUMN "source_channel_id" SET DEFAULT NULL`);
+ // await queryRunner.query(`ALTER TABLE "webhooks" ADD CONSTRAINT "fk_d64f38834fa676f6caa4786ddd6" FOREIGN KEY ("source_channel_id") REFERENCES "channels"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
+ }
}
diff --git a/src/util/migration/postgres/1760694225225-message_interaction_metadata.ts b/src/util/migration/postgres/1760694225225-message_interaction_metadata.ts
index 317361da..2b4afed7 100644
--- a/src/util/migration/postgres/1760694225225-message_interaction_metadata.ts
+++ b/src/util/migration/postgres/1760694225225-message_interaction_metadata.ts
@@ -1,13 +1,13 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class MessageInteractionMetadata1760694225225 implements MigrationInterface {
- name = "MessageInteractionMetadata1760694225225";
+ name = "MessageInteractionMetadata1760694225225";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "messages" ADD "interaction_metadata" text`);
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "messages" ADD "interaction_metadata" text`);
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "messages" DROP COLUMN "interaction_metadata"`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "messages" DROP COLUMN "interaction_metadata"`);
+ }
}
diff --git a/src/util/migration/postgres/1760961911873-message_reference_fix.ts b/src/util/migration/postgres/1760961911873-message_reference_fix.ts
index 1f61ab17..6a295981 100644
--- a/src/util/migration/postgres/1760961911873-message_reference_fix.ts
+++ b/src/util/migration/postgres/1760961911873-message_reference_fix.ts
@@ -1,19 +1,19 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class MessageReferenceFix1760961911873 implements MigrationInterface {
- name = "MessageReferenceFix1760961911873";
+ name = "MessageReferenceFix1760961911873";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "messages" DROP CONSTRAINT "FK_61a92bb65b302a76d9c1fcd3174"`);
- await queryRunner.query(
- `ALTER TABLE "messages" ADD CONSTRAINT "FK_61a92bb65b302a76d9c1fcd3174" FOREIGN KEY ("message_reference_id") REFERENCES "messages"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
- );
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "messages" DROP CONSTRAINT "FK_61a92bb65b302a76d9c1fcd3174"`);
+ await queryRunner.query(
+ `ALTER TABLE "messages" ADD CONSTRAINT "FK_61a92bb65b302a76d9c1fcd3174" FOREIGN KEY ("message_reference_id") REFERENCES "messages"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
+ );
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "messages" DROP CONSTRAINT "FK_61a92bb65b302a76d9c1fcd3174"`);
- await queryRunner.query(
- `ALTER TABLE "messages" ADD CONSTRAINT "FK_61a92bb65b302a76d9c1fcd3174" FOREIGN KEY ("message_reference_id") REFERENCES "messages"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
- );
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "messages" DROP CONSTRAINT "FK_61a92bb65b302a76d9c1fcd3174"`);
+ await queryRunner.query(
+ `ALTER TABLE "messages" ADD CONSTRAINT "FK_61a92bb65b302a76d9c1fcd3174" FOREIGN KEY ("message_reference_id") REFERENCES "messages"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
+ );
+ }
}
diff --git a/src/util/migration/postgres/1761113394664-delete-bot-users-without-an-application.ts b/src/util/migration/postgres/1761113394664-delete-bot-users-without-an-application.ts
index e3209927..cf770afc 100644
--- a/src/util/migration/postgres/1761113394664-delete-bot-users-without-an-application.ts
+++ b/src/util/migration/postgres/1761113394664-delete-bot-users-without-an-application.ts
@@ -1,10 +1,10 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class DeleteBotUsersWithoutAnApplication1761113394664 implements MigrationInterface {
- name = "DeleteBotUsersWithoutAnApplication1761113394664";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`DELETE FROM users WHERE bot = true AND id NOT IN (SELECT bot_user_id FROM applications);`);
- }
+ name = "DeleteBotUsersWithoutAnApplication1761113394664";
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`DELETE FROM users WHERE bot = true AND id NOT IN (SELECT bot_user_id FROM applications);`);
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {}
+ public async down(queryRunner: QueryRunner): Promise<void> {}
}
diff --git a/src/util/migration/postgres/1761209437070-application-commands-options-default.ts b/src/util/migration/postgres/1761209437070-application-commands-options-default.ts
index 1a1a4918..7eba1ee2 100644
--- a/src/util/migration/postgres/1761209437070-application-commands-options-default.ts
+++ b/src/util/migration/postgres/1761209437070-application-commands-options-default.ts
@@ -1,16 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class ApplicationCommandsOptionsDefault1761209437070 implements MigrationInterface {
- name = "ApplicationCommandsOptionsDefault1761209437070";
+ name = "ApplicationCommandsOptionsDefault1761209437070";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`UPDATE "application_commands" SET "options" = '[]' WHERE "options" IS NULL`);
- await queryRunner.query(`ALTER TABLE "application_commands" ALTER COLUMN "options" SET NOT NULL`);
- await queryRunner.query(`ALTER TABLE "application_commands" ALTER COLUMN "options" SET DEFAULT '[]'`);
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`UPDATE "application_commands" SET "options" = '[]' WHERE "options" IS NULL`);
+ await queryRunner.query(`ALTER TABLE "application_commands" ALTER COLUMN "options" SET NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "application_commands" ALTER COLUMN "options" SET DEFAULT '[]'`);
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "application_commands" ALTER COLUMN "options" DROP DEFAULT`);
- await queryRunner.query(`ALTER TABLE "application_commands" ALTER COLUMN "options" DROP NOT NULL`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "application_commands" ALTER COLUMN "options" DROP DEFAULT`);
+ await queryRunner.query(`ALTER TABLE "application_commands" ALTER COLUMN "options" DROP NOT NULL`);
+ }
}
diff --git a/src/util/migration/postgres/1762611552514-fix-gif-stickers-format_type.ts b/src/util/migration/postgres/1762611552514-fix-gif-stickers-format_type.ts
index 0e17bf81..c459cb5b 100644
--- a/src/util/migration/postgres/1762611552514-fix-gif-stickers-format_type.ts
+++ b/src/util/migration/postgres/1762611552514-fix-gif-stickers-format_type.ts
@@ -1,12 +1,12 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class FixGifStickersFormatType1762611552514 implements MigrationInterface {
- name = "FixGifStickersFormatType1762611552514";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`UPDATE "stickers" SET "format_type" = 4 WHERE "format_type" = 0;`);
- }
+ name = "FixGifStickersFormatType1762611552514";
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`UPDATE "stickers" SET "format_type" = 4 WHERE "format_type" = 0;`);
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`UPDATE "stickers" SET "format_type" = 0 WHERE "format_type" = 4;`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`UPDATE "stickers" SET "format_type" = 0 WHERE "format_type" = 4;`);
+ }
}
diff --git a/src/util/migration/postgres/1763630755675-default-activities-to-empty-array.ts b/src/util/migration/postgres/1763630755675-default-activities-to-empty-array.ts
index cc4b5337..ecb9d1ec 100644
--- a/src/util/migration/postgres/1763630755675-default-activities-to-empty-array.ts
+++ b/src/util/migration/postgres/1763630755675-default-activities-to-empty-array.ts
@@ -1,15 +1,15 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class DefaultActivitiesToEmptyArray1763630755675 implements MigrationInterface {
- name = "DefaultActivitiesToEmptyArray1763630755675";
+ name = "DefaultActivitiesToEmptyArray1763630755675";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "activities" SET NOT NULL`);
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "activities" SET DEFAULT '[]'`);
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "activities" SET NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "activities" SET DEFAULT '[]'`);
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "activities" DROP DEFAULT`);
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "activities" DROP NOT NULL`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "activities" DROP DEFAULT`);
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "activities" DROP NOT NULL`);
+ }
}
diff --git a/src/util/migration/postgres/1765143034407-DontIpBanBanner.ts b/src/util/migration/postgres/1765143034407-DontIpBanBanner.ts
index 2207e9c0..249c6478 100644
--- a/src/util/migration/postgres/1765143034407-DontIpBanBanner.ts
+++ b/src/util/migration/postgres/1765143034407-DontIpBanBanner.ts
@@ -1,15 +1,15 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class DontIpBanBanner1765143034407 implements MigrationInterface {
- name = "DontIpBanBanner1765143034407";
+ name = "DontIpBanBanner1765143034407";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "bans" ALTER COLUMN "ip" DROP NOT NULL`);
- await queryRunner.query(`UPDATE "bans" SET "ip" = NULL`);
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "bans" ALTER COLUMN "ip" DROP NOT NULL`);
+ await queryRunner.query(`UPDATE "bans" SET "ip" = NULL`);
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`UPDATE "bans" SET "ip" = '0.0.0.0' WHERE "ip" IS NULL`);
- await queryRunner.query(`ALTER TABLE "bans" ALTER COLUMN "ip" SET NOT NULL`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`UPDATE "bans" SET "ip" = '0.0.0.0' WHERE "ip" IS NULL`);
+ await queryRunner.query(`ALTER TABLE "bans" ALTER COLUMN "ip" SET NOT NULL`);
+ }
}
diff --git a/src/util/migration/postgres/1765578570423-InstanceBanTable.ts b/src/util/migration/postgres/1765578570423-InstanceBanTable.ts
index be8cb9cc..205e150d 100644
--- a/src/util/migration/postgres/1765578570423-InstanceBanTable.ts
+++ b/src/util/migration/postgres/1765578570423-InstanceBanTable.ts
@@ -1,19 +1,19 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class InstanceBanTable1765578570423 implements MigrationInterface {
- name = "InstanceBanTable1765578570423";
+ name = "InstanceBanTable1765578570423";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(
- `CREATE TABLE "instance_bans" ("id" character varying NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "reason" character varying NOT NULL, "user_id" character varying, "fingerprint" character varying, "ip_address" character varying, "is_from_other_instance_ban" boolean NOT NULL DEFAULT false, "origin_instance_ban_id" character varying, CONSTRAINT "REL_0b02d18d0d830f160c921192a3" UNIQUE ("origin_instance_ban_id"), CONSTRAINT "PK_3aa6e80a6d325601054892b1340" PRIMARY KEY ("id"))`,
- );
- await queryRunner.query(
- `ALTER TABLE "instance_bans" ADD CONSTRAINT "FK_0b02d18d0d830f160c921192a30" FOREIGN KEY ("origin_instance_ban_id") REFERENCES "instance_bans"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
- );
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ `CREATE TABLE "instance_bans" ("id" character varying NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "reason" character varying NOT NULL, "user_id" character varying, "fingerprint" character varying, "ip_address" character varying, "is_from_other_instance_ban" boolean NOT NULL DEFAULT false, "origin_instance_ban_id" character varying, CONSTRAINT "REL_0b02d18d0d830f160c921192a3" UNIQUE ("origin_instance_ban_id"), CONSTRAINT "PK_3aa6e80a6d325601054892b1340" PRIMARY KEY ("id"))`,
+ );
+ await queryRunner.query(
+ `ALTER TABLE "instance_bans" ADD CONSTRAINT "FK_0b02d18d0d830f160c921192a30" FOREIGN KEY ("origin_instance_ban_id") REFERENCES "instance_bans"("id") ON DELETE SET NULL ON UPDATE NO ACTION`,
+ );
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "instance_bans" DROP CONSTRAINT "FK_0b02d18d0d830f160c921192a30"`);
- await queryRunner.query(`DROP TABLE "instance_bans"`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "instance_bans" DROP CONSTRAINT "FK_0b02d18d0d830f160c921192a30"`);
+ await queryRunner.query(`DROP TABLE "instance_bans"`);
+ }
}
diff --git a/src/util/migration/postgres/1765587835846-InstanceBanAllowlist.ts b/src/util/migration/postgres/1765587835846-InstanceBanAllowlist.ts
index 8c907aa9..9eefea48 100644
--- a/src/util/migration/postgres/1765587835846-InstanceBanAllowlist.ts
+++ b/src/util/migration/postgres/1765587835846-InstanceBanAllowlist.ts
@@ -1,13 +1,13 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class InstanceBanAllowlist1765587835846 implements MigrationInterface {
- name = "InstanceBanAllowlist1765587835846";
+ name = "InstanceBanAllowlist1765587835846";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "instance_bans" ADD "is_allowlisted" boolean NOT NULL DEFAULT false`);
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "instance_bans" ADD "is_allowlisted" boolean NOT NULL DEFAULT false`);
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "instance_bans" DROP COLUMN "is_allowlisted"`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "instance_bans" DROP COLUMN "is_allowlisted"`);
+ }
}
diff --git a/src/util/migration/postgres/1765665440000-DropDefaultIPDataKey.ts b/src/util/migration/postgres/1765665440000-DropDefaultIPDataKey.ts
index ea887b1b..2e58ff7d 100644
--- a/src/util/migration/postgres/1765665440000-DropDefaultIPDataKey.ts
+++ b/src/util/migration/postgres/1765665440000-DropDefaultIPDataKey.ts
@@ -1,17 +1,17 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class DropDefaultIPDataKey1765665440000 implements MigrationInterface {
- name = "DropDefaultIPDataKey1765665440000";
+ name = "DropDefaultIPDataKey1765665440000";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(
- `UPDATE "config" SET "value" = NULL WHERE "key" = 'security_ipdataApiKey' AND "value" = '"eca677b284b3bac29eb72f5e496aa9047f26543605efe99ff2ce35c9"'`,
- );
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ `UPDATE "config" SET "value" = NULL WHERE "key" = 'security_ipdataApiKey' AND "value" = '"eca677b284b3bac29eb72f5e496aa9047f26543605efe99ff2ce35c9"'`,
+ );
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(
- `UPDATE "config" SET "value" = '"eca677b284b3bac29eb72f5e496aa9047f26543605efe99ff2ce35c9"' WHERE "key" = 'security_ipdataApiKey' AND "value" IS NULL`,
- );
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ `UPDATE "config" SET "value" = '"eca677b284b3bac29eb72f5e496aa9047f26543605efe99ff2ce35c9"' WHERE "key" = 'security_ipdataApiKey' AND "value" IS NULL`,
+ );
+ }
}
diff --git a/src/util/migration/postgres/1765863159930-ExtendedSessionInfo.ts b/src/util/migration/postgres/1765863159930-ExtendedSessionInfo.ts
index c320ed7b..d6271cfe 100644
--- a/src/util/migration/postgres/1765863159930-ExtendedSessionInfo.ts
+++ b/src/util/migration/postgres/1765863159930-ExtendedSessionInfo.ts
@@ -1,41 +1,41 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class ExtendedSessionInfo1765863159930 implements MigrationInterface {
- name = "ExtendedSessionInfo1765863159930";
+ name = "ExtendedSessionInfo1765863159930";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "sessions" DROP CONSTRAINT "PK_3238ef96f18b355b671619111bc"`);
- await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "id"`);
- await queryRunner.query(`ALTER TABLE "sessions" ADD "is_admin_session" boolean NOT NULL DEFAULT false`);
- await queryRunner.query(`ALTER TABLE "sessions" ADD "created_at" TIMESTAMP NOT NULL DEFAULT now()`);
- await queryRunner.query(`ALTER TABLE "sessions" ADD "last_seen" TIMESTAMP NOT NULL DEFAULT '1970-01-01 00:00:00'`);
- await queryRunner.query(`ALTER TABLE "sessions" ADD "last_seen_ip" character varying NOT NULL DEFAULT '127.0.0.1'`);
- await queryRunner.query(`ALTER TABLE "sessions" ADD "last_seen_location" character varying`);
- await queryRunner.query(`ALTER TABLE "webhooks" ALTER COLUMN "source_channel_id" DROP DEFAULT`);
- await queryRunner.query(`ALTER TABLE "sessions" DROP CONSTRAINT "FK_085d540d9f418cfbdc7bd55bb19"`);
- await queryRunner.query(`ALTER TABLE "sessions" ADD CONSTRAINT "PK_9340188c93349808f10d1db74a8" PRIMARY KEY ("session_id")`);
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "user_id" SET NOT NULL`);
- await queryRunner.query(`CREATE INDEX "IDX_085d540d9f418cfbdc7bd55bb1" ON "sessions" ("user_id") `);
- await queryRunner.query(
- `ALTER TABLE "sessions" ADD CONSTRAINT "FK_085d540d9f418cfbdc7bd55bb19" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
- );
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "sessions" DROP CONSTRAINT "PK_3238ef96f18b355b671619111bc"`);
+ await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "id"`);
+ await queryRunner.query(`ALTER TABLE "sessions" ADD "is_admin_session" boolean NOT NULL DEFAULT false`);
+ await queryRunner.query(`ALTER TABLE "sessions" ADD "created_at" TIMESTAMP NOT NULL DEFAULT now()`);
+ await queryRunner.query(`ALTER TABLE "sessions" ADD "last_seen" TIMESTAMP NOT NULL DEFAULT '1970-01-01 00:00:00'`);
+ await queryRunner.query(`ALTER TABLE "sessions" ADD "last_seen_ip" character varying NOT NULL DEFAULT '127.0.0.1'`);
+ await queryRunner.query(`ALTER TABLE "sessions" ADD "last_seen_location" character varying`);
+ await queryRunner.query(`ALTER TABLE "webhooks" ALTER COLUMN "source_channel_id" DROP DEFAULT`);
+ await queryRunner.query(`ALTER TABLE "sessions" DROP CONSTRAINT "FK_085d540d9f418cfbdc7bd55bb19"`);
+ await queryRunner.query(`ALTER TABLE "sessions" ADD CONSTRAINT "PK_9340188c93349808f10d1db74a8" PRIMARY KEY ("session_id")`);
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "user_id" SET NOT NULL`);
+ await queryRunner.query(`CREATE INDEX "IDX_085d540d9f418cfbdc7bd55bb1" ON "sessions" ("user_id") `);
+ await queryRunner.query(
+ `ALTER TABLE "sessions" ADD CONSTRAINT "FK_085d540d9f418cfbdc7bd55bb19" 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 "sessions" DROP CONSTRAINT "FK_085d540d9f418cfbdc7bd55bb19"`);
- await queryRunner.query(`ALTER TABLE "webhooks" DROP CONSTRAINT "FK_4495b7032a33c6b8b605d030398"`);
- await queryRunner.query(`DROP INDEX "public"."IDX_085d540d9f418cfbdc7bd55bb1"`);
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "user_id" DROP NOT NULL`);
- await queryRunner.query(`ALTER TABLE "sessions" DROP CONSTRAINT "PK_9340188c93349808f10d1db74a8"`);
- await queryRunner.query(
- `ALTER TABLE "sessions" ADD CONSTRAINT "FK_085d540d9f418cfbdc7bd55bb19" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
- );
- await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "last_seen_location"`);
- await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "last_seen_ip"`);
- await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "last_seen"`);
- await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "created_at"`);
- await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "is_admin_session"`);
- await queryRunner.query(`ALTER TABLE "sessions" ADD "id" character varying NOT NULL`);
- await queryRunner.query(`ALTER TABLE "sessions" ADD CONSTRAINT "PK_3238ef96f18b355b671619111bc" PRIMARY KEY ("id")`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "sessions" DROP CONSTRAINT "FK_085d540d9f418cfbdc7bd55bb19"`);
+ await queryRunner.query(`ALTER TABLE "webhooks" DROP CONSTRAINT "FK_4495b7032a33c6b8b605d030398"`);
+ await queryRunner.query(`DROP INDEX "public"."IDX_085d540d9f418cfbdc7bd55bb1"`);
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "user_id" DROP NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "sessions" DROP CONSTRAINT "PK_9340188c93349808f10d1db74a8"`);
+ await queryRunner.query(
+ `ALTER TABLE "sessions" ADD CONSTRAINT "FK_085d540d9f418cfbdc7bd55bb19" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
+ );
+ await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "last_seen_location"`);
+ await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "last_seen_ip"`);
+ await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "last_seen"`);
+ await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "created_at"`);
+ await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "is_admin_session"`);
+ await queryRunner.query(`ALTER TABLE "sessions" ADD "id" character varying NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "sessions" ADD CONSTRAINT "PK_3238ef96f18b355b671619111bc" PRIMARY KEY ("id")`);
+ }
}
diff --git a/src/util/migration/postgres/1765932247127-UpdateSessionInfo.ts b/src/util/migration/postgres/1765932247127-UpdateSessionInfo.ts
index 3da3498a..fb8a7e56 100644
--- a/src/util/migration/postgres/1765932247127-UpdateSessionInfo.ts
+++ b/src/util/migration/postgres/1765932247127-UpdateSessionInfo.ts
@@ -1,23 +1,23 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateSessionInfo1765932247127 implements MigrationInterface {
- name = "UpdateSessionInfo1765932247127";
+ name = "UpdateSessionInfo1765932247127";
- public async up(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "sessions" ADD "last_seen_location_info" text`);
- await queryRunner.query(`ALTER TABLE "sessions" ADD "session_nickname" character varying`);
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen" DROP NOT NULL`);
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen" DROP DEFAULT`);
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen_ip" DROP NOT NULL`);
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen_ip" DROP DEFAULT`);
- }
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "sessions" ADD "last_seen_location_info" text`);
+ await queryRunner.query(`ALTER TABLE "sessions" ADD "session_nickname" character varying`);
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen" DROP NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen" DROP DEFAULT`);
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen_ip" DROP NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen_ip" DROP DEFAULT`);
+ }
- public async down(queryRunner: QueryRunner): Promise<void> {
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen_ip" SET DEFAULT '127.0.0.1'`);
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen_ip" SET NOT NULL`);
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen" SET DEFAULT '1970-01-01 00:00:00'`);
- await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen" SET NOT NULL`);
- await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "session_nickname"`);
- await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "last_seen_location_info"`);
- }
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen_ip" SET DEFAULT '127.0.0.1'`);
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen_ip" SET NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen" SET DEFAULT '1970-01-01 00:00:00'`);
+ await queryRunner.query(`ALTER TABLE "sessions" ALTER COLUMN "last_seen" SET NOT NULL`);
+ await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "session_nickname"`);
+ await queryRunner.query(`ALTER TABLE "sessions" DROP COLUMN "last_seen_location_info"`);
+ }
}
|