aboutsummaryrefslogtreecommitdiff
path: root/bot/src/db
diff options
context:
space:
mode:
Diffstat (limited to 'bot/src/db')
-rw-r--r--bot/src/db/migrations/20250401223204-rename-logchannelid.js45
-rw-r--r--bot/src/db/models/guild-settings.js10
-rw-r--r--bot/src/db/models/warn.js42
3 files changed, 96 insertions, 1 deletions
diff --git a/bot/src/db/migrations/20250401223204-rename-logchannelid.js b/bot/src/db/migrations/20250401223204-rename-logchannelid.js
new file mode 100644
index 0000000..2313c4f
--- /dev/null
+++ b/bot/src/db/migrations/20250401223204-rename-logchannelid.js
@@ -0,0 +1,45 @@
+'use strict';
+
+/** @type {import('sequelize-cli').Migration} */
+export const up = async (queryInterface, Sequelize) => {
+// Assuming we have a table in SQLite created as follows:
+ await queryInterface.createTable('guild-settings', {
+ id: {
+ type: Sequelize.INTEGER,
+ primaryKey: true,
+ autoIncrement: true,
+ },
+ guildID: {
+ type: Sequelize.STRING,
+ allowNull: false
+ },
+ memberLogChannelID: {
+ type: Sequelize.STRING,
+ allowNull: true
+ },
+ messageLogChannelID: {
+ type: Sequelize.STRING,
+ allowNull: true
+ },
+ suggestionsChannelID: {
+ type: Sequelize.STRING,
+ allowNull: true
+ },
+ qotdChannelID: {
+ type: Sequelize.STRING,
+ allowNull: true
+ },
+ qotdToggle: {
+ type: Sequelize.BOOLEAN,
+ allowNull: true
+ },
+ ollamaEnabled: {
+ type: Sequelize.BOOLEAN,
+ allowNull: true
+ },
+ });
+};
+
+export const down = async (queryInterface) => {
+
+};
diff --git a/bot/src/db/models/guild-settings.js b/bot/src/db/models/guild-settings.js
index c6bcaa4..09cddd2 100644
--- a/bot/src/db/models/guild-settings.js
+++ b/bot/src/db/models/guild-settings.js
@@ -11,7 +11,15 @@ export const guildSettings = sequelize.define('guild-settings', {
type: STRING,
allowNull: false
},
- logChannelID: {
+ memberLogChannelID: {
+ type: STRING,
+ allowNull: true
+ },
+ messageLogChannelID: {
+ type: STRING,
+ allowNull: true
+ },
+ warnLogChannelID: {
type: STRING,
allowNull: true
},
diff --git a/bot/src/db/models/warn.js b/bot/src/db/models/warn.js
new file mode 100644
index 0000000..d766238
--- /dev/null
+++ b/bot/src/db/models/warn.js
@@ -0,0 +1,42 @@
+import { INTEGER, STRING } from 'sequelize';
+import { sequelize } from '../../utils/sequelize.js';
+
+export const warnSettings = sequelize.define('warn-settings', {
+ id: {
+ type: INTEGER,
+ primaryKey: true,
+ autoIncrement: true,
+ },
+ guildID: {
+ type: STRING,
+ allowNull: false
+ },
+ strikes: {
+ type: STRING,
+ allowNull: false
+ },
+ punishment: {
+ type: STRING,
+ allowNull: false
+ }
+});
+
+export const warnLog = sequelize.define('warn-log', {
+ id: {
+ type: INTEGER,
+ primaryKey: true,
+ autoIncrement: true,
+ },
+ guildID: {
+ type: STRING,
+ allowNull: false
+ },
+ userID: {
+ type: STRING,
+ allowNull: false
+ },
+ reason: {
+ type: STRING,
+ allowNull: false
+ }
+});