mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 08:20:58 -05:00
35 lines
990 B
TypeScript
35 lines
990 B
TypeScript
import {Sequelize, DataTypes, Model, InferAttributes, InferCreationAttributes} from 'sequelize';
|
|
var db = new Sequelize('database', 'daggerbot', 'toastsus', {
|
|
host: 'localhost',
|
|
dialect: 'sqlite',
|
|
logging: false,
|
|
storage: 'src/database/MPDB.dat'
|
|
})
|
|
class MPDB extends Model<InferAttributes<MPDB>, InferCreationAttributes<MPDB>>{
|
|
declare serverId: string | null;
|
|
declare ip: string | null;
|
|
declare code: string | null;
|
|
declare timesUpdated: number | null;
|
|
}
|
|
MPDB.init({
|
|
serverId: {
|
|
type: DataTypes.STRING,
|
|
unique: true
|
|
},
|
|
ip: {
|
|
type: DataTypes.STRING,
|
|
defaultValue: 'Missing IP',
|
|
allowNull: false
|
|
},
|
|
code: {
|
|
type: DataTypes.STRING,
|
|
defaultValue: 'Missing Code',
|
|
allowNull: false
|
|
},
|
|
timesUpdated: {
|
|
type: DataTypes.INTEGER,
|
|
defaultValue: 0,
|
|
allowNull: false
|
|
}
|
|
}, { sequelize: db, modelName: 'urls', timestamps: false });
|
|
export default MPDB |