add Ban sql table and remove blacklist
This commit is contained in:
parent
fc5581e00d
commit
53b8168f24
36
src/data/sql/Ban.js
Normal file
36
src/data/sql/Ban.js
Normal 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;
|
|
@ -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;
|
|
Loading…
Reference in New Issue
Block a user