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;