Database things, pinned messages, start on ticket claiming

This commit is contained in:
Isaac
2021-05-03 16:30:52 +01:00
parent eb1fb737bb
commit a7248d88ea
13 changed files with 169 additions and 49 deletions

View File

@@ -39,6 +39,7 @@ module.exports = async (client) => {
storage: path('./user/database.sqlite'),
logging: text => client.log.debug(text)
});
client.log.warn('SQLite is not sufficient for a production environment if you want to use ticket archives. You should disable "log_messages" in your servers\' settings or use a different database.');
} else {
client.log.info(`Connecting to ${types[type].name} database...`);
sequelize = new Sequelize(DB_NAME, DB_USER, DB_PASS, {

View File

@@ -7,6 +7,10 @@ module.exports = ({ config }, sequelize) => {
primaryKey: true,
allowNull: false,
},
claiming: {
type: DataTypes.BOOLEAN,
defaultValue: false,
},
guild: {
type: DataTypes.CHAR(19),
allowNull: false,

View File

@@ -15,6 +15,10 @@ module.exports = (client, sequelize) => {
key: 'id'
},
},
claimed_by: {
type: DataTypes.CHAR(19),
allowNull: true,
},
closed_by: {
type: DataTypes.CHAR(19),
allowNull: true,
@@ -53,6 +57,10 @@ module.exports = (client, sequelize) => {
type: DataTypes.CHAR(19),
allowNull: true,
},
pinned_messages: {
type: DataTypes.JSON,
defaultValue: []
},
topic: {
type: DataTypes.TEXT,
allowNull: true,