mirror of
https://github.com/spacebarchat/server.git
synced 2026-08-29 07:39:00 +00:00
Perhaps, dont IP ban moderators
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -215,7 +215,6 @@ router.put(
|
||||
const ban = Ban.create({
|
||||
user_id: banned_user_id,
|
||||
guild_id: guild_id,
|
||||
ip: getIpAdress(req),
|
||||
executor_id: req.user_id,
|
||||
reason: req.body.reason, // || otherwise empty
|
||||
});
|
||||
|
||||
@@ -53,8 +53,8 @@ export class Ban extends BaseClass {
|
||||
@ManyToOne(() => User)
|
||||
executor: User;
|
||||
|
||||
@Column()
|
||||
ip: string;
|
||||
@Column({ nullable: true })
|
||||
ip?: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
reason?: string;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class DontIpBanBanner1765143034407 implements MigrationInterface {
|
||||
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 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`);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user