thezeeone / ZBot-En

A multi-purpose bot you can add to your server.
3 stars 0 forks source link

RankCardModel issue #11

Closed thezeeone closed 2 years ago

thezeeone commented 2 years ago

Description:

  [...]: error: value "xxxxxxxxxxxxxxxxxxxx" is out of range for type integer

(see images below) image image

High Severity Issue that affects both bots.

Commands Affected /rank - ALL subcommand groups

Cause Conflicting data types while setting up RankCardModel. The table is already named as RankCards with the model implemented, and changing the C to c still has no effect, neither does adding a 2 at the end.

interface RankCardModel extends Model<InferAttributes<RankCardModel>, InferCreationAttributes<RankCardModel>> {
    id: string,
    colour: number
}

(base)/database.ts:19-22

const RankCardModel = sequelize.define<RankCardModel>('Rankcards', {
    id: {
        primaryKey: true,
        type: DataTypes.NUMBER
    },
    colour: {
        type: DataTypes.INTEGER,
        defaultValue: 0x00ffff
    }
})

(base)/database.ts:33-42 (this was an accident, I changed the type property of id to DataTypes.STRING however is still causing the error because the database already has the base model with the incorrect type set up)

Changes to be made database.ts - change model rank.ts - comment out lines or sections of lines of code that use or include it

#ff0000 HIGH SEVERITY ISSUE that is causing the bot to break when the /rank command is used. Was unnoticed during #10 the merging of revamp to main.

Refer to #zbot-announcements for the latest updates while we're at it.

thezeeone commented 2 years ago

Commented out lines of code that include RankCardModel users can no longer

thezeeone commented 2 years ago

reopened

thezeeone commented 2 years ago

Fixed