3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

feat: add member cache; handle all role changes with RoleManagerPlugin; exit gracefully

This commit is contained in:
Dragory 2023-05-07 17:56:55 +03:00
parent fd60a09947
commit fa50110766
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
48 changed files with 755 additions and 264 deletions

View file

@ -0,0 +1,69 @@
import { MigrationInterface, QueryRunner, Table } from "typeorm";
export class CreateMemberCacheTable1682788165866 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: "member_cache",
columns: [
{
name: "id",
type: "int",
isPrimary: true,
isGenerated: true,
generationStrategy: "increment",
},
{
name: "guild_id",
type: "bigint",
},
{
name: "user_id",
type: "bigint",
},
{
name: "username",
type: "varchar",
length: "255",
},
{
name: "nickname",
type: "varchar",
length: "255",
isNullable: true,
},
{
name: "roles",
type: "text",
},
{
name: "last_seen",
type: "date",
},
{
name: "delete_at",
type: "datetime",
isNullable: true,
default: null,
},
],
indices: [
{
columnNames: ["guild_id", "user_id"],
isUnique: true,
},
{
columnNames: ["last_seen"],
},
{
columnNames: ["delete_at"],
},
],
}),
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable("member_cache");
}
}