Merge branch 'master' of https://github.com/DEVTomatoCake/spacebar-server into feat/webhooks-3
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class MessageFlagsNotNull1713116476900 implements MigrationInterface {
|
||||
name = "MessageFlagsNotNull1713116476900";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
"ALTER TABLE `messages` CHANGE flags flags_old integer;",
|
||||
);
|
||||
await queryRunner.query(
|
||||
"ALTER TABLE `messages` ADD flags integer NOT NULL DEFAULT 0;",
|
||||
);
|
||||
await queryRunner.query(
|
||||
"UPDATE `messages` SET flags = IFNULL(flags_old, 0);",
|
||||
);
|
||||
await queryRunner.query(
|
||||
"ALTER TABLE `messages` DROP COLUMN flags_old;",
|
||||
);
|
||||
}
|
||||
|
||||
public async down(): Promise<void> {
|
||||
// dont care
|
||||
throw new Error("Migration down is not implemented.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class NewUserSettings1719776735000 implements MigrationInterface {
|
||||
name = "NewUserSettings1719776735000";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
"ALTER TABLE `user_settings` ADD friend_discovery_flags integer NULL DEFAULT 0;",
|
||||
);
|
||||
await queryRunner.query(
|
||||
"ALTER TABLE `user_settings` ADD view_nsfw_guilds tinyint NULL DEFAULT 1;",
|
||||
);
|
||||
}
|
||||
|
||||
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;",
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class MessagePollObject1720157926878 implements MigrationInterface {
|
||||
name = "MessagePollObject1720157926878";
|
||||
|
||||
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`");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class Badges1720628601997 implements MigrationInterface {
|
||||
name = "Badges1720628601997";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE \`badges\` (\`id\` varchar(255) NOT NULL, \`description\` varchar(255) NOT NULL, \`icon\` varchar(255) NOT NULL, \`link\` varchar(255) NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE \`users\` ADD \`badge_ids\` text NULL`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE \`users\` DROP COLUMN \`badge_ids\``,
|
||||
);
|
||||
await queryRunner.query(`DROP TABLE \`badges\``);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user