This repository has been archived on 2026-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
ServerSpacebarOld/src/util/migration/postgres/1761113394664-delete-bot-users-without-an-application.ts

10 lines
401 B
TypeScript

import { MigrationInterface, QueryRunner } from "typeorm";
export class DeleteBotUsersWithoutAnApplication1761113394664 implements MigrationInterface {
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> {}
}