blob: 51e571a30640b1fcd0fef62659c22807842ceddf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
import { type Sequelize } from 'sequelize';
import { Environment } from '../../../../config/Config.js';
const { DataTypes, Model } = (await import('sequelize')).default;
export interface GuildCountModel {
timestamp: Date;
environment: Environment;
guildCount: number;
}
export interface GuildCountCreationAttributes {
timestamp?: Date;
environment: Environment;
guildCount: number;
}
/**
* The number of guilds that the bot is in for each environment.
*/
export class GuildCount extends Model<GuildCountModel, GuildCountCreationAttributes> implements GuildCountModel {
public declare timestamp: Date;
public declare environment: Environment;
public declare guildCount: number;
/**
* Initializes the model.
* @param sequelize The sequelize instance.
*/
public static initModel(sequelize: Sequelize): void {
GuildCount.init(
{
timestamp: { type: DataTypes.DATE, allowNull: false, defaultValue: DataTypes.NOW },
environment: { type: DataTypes.STRING, allowNull: false },
guildCount: { type: DataTypes.BIGINT, allowNull: false }
},
{ sequelize, timestamps: false }
);
}
}
|