mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-14 11:35:48 +00:00
Make teams nullable
This commit is contained in:
@@ -23,10 +23,9 @@ router.post("/", route({}), async (req: Request, res: Response) => {
|
||||
name: trimSpecial(body.name),
|
||||
description: "",
|
||||
bot_public: true,
|
||||
bot_require_code_grant: false,
|
||||
owner: user,
|
||||
verify_key: "IMPLEMENTME",
|
||||
flags: ""
|
||||
flags: 0
|
||||
});
|
||||
await app.save();
|
||||
res.json(app).status(200);
|
||||
|
||||
@@ -104,6 +104,7 @@ export class Application extends BaseClass {
|
||||
@JoinColumn({ name: "team_id" })
|
||||
@ManyToOne(() => Team, {
|
||||
onDelete: "CASCADE",
|
||||
nullable: true
|
||||
})
|
||||
team?: Team;
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class appsNullableTeam1660131942703 implements MigrationInterface {
|
||||
name = 'appsNullableTeam1660131942703'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
DROP INDEX \`IDX_2ce5a55796fe4c2f77ece57a64\` ON \`applications\`
|
||||
`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
CREATE UNIQUE INDEX \`IDX_2ce5a55796fe4c2f77ece57a64\` ON \`applications\` (\`bot_user_id\`)
|
||||
`);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user