Created the Achievement.ts model

This commit is contained in:
Mathias Wagner 2023-11-12 16:18:09 +01:00
parent 5851d74798
commit 8ef5e66bd4
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

25
models/Achievement.ts Normal file
View File

@ -0,0 +1,25 @@
import {DataTypes, InferAttributes, InferCreationAttributes, Model} from "sequelize";
import {sequelize} from "../app";
export interface IAchievement extends Model<InferAttributes<IAchievement>, InferCreationAttributes<IAchievement>> {
guildId: number
categoryId: number
achievementId: number
}
const AchievementSchema = sequelize.define<IAchievement>('achievements', {
guildId: {
type: DataTypes.BIGINT,
allowNull: false
},
categoryId: {
type: DataTypes.INTEGER,
allowNull: false
},
achievementId: {
type: DataTypes.INTEGER,
allowNull: false
}
}, {createdAt: false, updatedAt: false});
export const Achievement = AchievementSchema;