mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-22 17:32:30 +00:00
Add discovery filtering
This commit is contained in:
1 parent
48f594a5b9
commit
b7f3535d09
5 files changed
+36
-25
No files matched your search
@@ -298,6 +298,12 @@ export class Guild extends BaseClass {
|
||||
@Column({ select: false, type: "simple-array" })
|
||||
channel_ordering: string[];
|
||||
|
||||
@Column()
|
||||
discovery_weight: number = 0;
|
||||
|
||||
@Column()
|
||||
discovery_excluded: boolean = false;
|
||||
|
||||
static async createGuild(body: {
|
||||
name?: string;
|
||||
icon?: string | null;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class GuildDiscoveryHoisting1770748070808 implements MigrationInterface {
|
||||
name = "GuildDiscoveryHoisting1770748070808";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "guilds" ADD "discovery_weight" integer NOT NULL`);
|
||||
await queryRunner.query(`ALTER TABLE "guilds" ADD "discovery_excluded" boolean NOT NULL`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "guilds" DROP COLUMN "discovery_excluded"`);
|
||||
await queryRunner.query(`ALTER TABLE "guilds" DROP COLUMN "discovery_weight"`);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user