add Ban sql table and remove blacklist

This commit is contained in:
HF 2022-08-05 01:32:08 +02:00
parent fc5581e00d
commit 53b8168f24
2 changed files with 36 additions and 21 deletions

36
src/data/sql/Ban.js Normal file
View File

@ -0,0 +1,36 @@
import { DataTypes } from 'sequelize';
import sequelize from './sequelize';
const Ban = sequelize.define('Blacklist', {
ip: {
type: DataTypes.CHAR(39),
allowNull: false,
primaryKey: true,
},
reason: {
type: `${DataTypes.CHAR(200)} CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci`,
allowNull: false,
},
/*
* wpiration time,
* NULL if infinite
*/
expires: {
type: DataTypes.DATE,
},
/*
* uid of mod who made the ban
*/
muid: {
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
},
}, {
timestamps: true,
updatedAt: false,
});
export default Ban;

View File

@ -1,21 +0,0 @@
/**
*
* https://github.com/sequelize/sequelize/issues/1485#issuecomment-243822779
*
*/
import { DataTypes } from 'sequelize';
import sequelize from './sequelize';
const Blacklist = sequelize.define('Blacklist', {
ip: {
type: DataTypes.CHAR(39),
allowNull: false,
primaryKey: true,
},
});
export default Blacklist;