aboutsummaryrefslogtreecommitdiff
path: root/bot/src/db
diff options
context:
space:
mode:
authorAndrew Lee <andrew@alee14.me>2025-03-30 17:05:51 -0400
committerAndrew Lee <andrew@alee14.me>2025-03-30 17:07:09 -0400
commit1662608835099ee3176d07d67c6a3c69f716f938 (patch)
tree6a891bdc439c32e0c10369d91e55c9b4e444c65f /bot/src/db
parent3c61c156137984cf61d3517d4d9633ca6de072f6 (diff)
downloadAleeBot-1662608835099ee3176d07d67c6a3c69f716f938.tar.gz
AleeBot-1662608835099ee3176d07d67c6a3c69f716f938.tar.bz2
AleeBot-1662608835099ee3176d07d67c6a3c69f716f938.zip
Fixed issues; Generate bot invite; Added database migrations
Diffstat (limited to 'bot/src/db')
-rw-r--r--bot/src/db/config/config.json20
-rw-r--r--bot/src/db/migrations/20250330201535-update-guild-settings.js31
-rw-r--r--bot/src/db/migrations/20250330202144-command-usages.js31
3 files changed, 82 insertions, 0 deletions
diff --git a/bot/src/db/config/config.json b/bot/src/db/config/config.json
new file mode 100644
index 0000000..6efe0e6
--- /dev/null
+++ b/bot/src/db/config/config.json
@@ -0,0 +1,20 @@
+{
+ "development": {
+ "host": "localhost",
+ "dialect": "sqlite",
+ "logging": false,
+ "storage": "database.db"
+ },
+ "test": {
+ "host": "localhost",
+ "dialect": "sqlite",
+ "logging": false,
+ "storage": "database.db"
+ },
+ "production": {
+ "host": "localhost",
+ "dialect": "sqlite",
+ "logging": false,
+ "storage": "database.db"
+ }
+}
diff --git a/bot/src/db/migrations/20250330201535-update-guild-settings.js b/bot/src/db/migrations/20250330201535-update-guild-settings.js
new file mode 100644
index 0000000..1d4a4d3
--- /dev/null
+++ b/bot/src/db/migrations/20250330201535-update-guild-settings.js
@@ -0,0 +1,31 @@
+'use strict';
+
+/** @type {import('sequelize-cli').Migration} */
+export const up = async (queryInterface, Sequelize) => {
+ await queryInterface.addColumn('guild-settings', 'suggestionsChannelID', {
+ type: Sequelize.STRING,
+ allowNull: true
+ });
+
+ await queryInterface.addColumn('guild-settings', 'qotdChannelID', {
+ type: Sequelize.STRING,
+ allowNull: true
+ });
+
+ await queryInterface.addColumn('guild-settings', 'qotdToggle', {
+ type: Sequelize.BOOLEAN,
+ allowNull: true
+ });
+
+ await queryInterface.addColumn('guild-settings', 'ollamaEnabled', {
+ type: Sequelize.BOOLEAN,
+ allowNull: true
+ });
+};
+
+export const down = async (queryInterface) => {
+ await queryInterface.removeColumn('guild-settings', 'suggestionsChannelID');
+ await queryInterface.removeColumn('guild-settings', 'qotdChannelID');
+ await queryInterface.removeColumn('guild-settings', 'qotdToggle');
+ await queryInterface.removeColumn('guild-settings', 'ollamaEnabled');
+};
diff --git a/bot/src/db/migrations/20250330202144-command-usages.js b/bot/src/db/migrations/20250330202144-command-usages.js
new file mode 100644
index 0000000..095f817
--- /dev/null
+++ b/bot/src/db/migrations/20250330202144-command-usages.js
@@ -0,0 +1,31 @@
+'use strict';
+
+/** @type {import('sequelize-cli').Migration} */
+export const up = async (queryInterface, Sequelize) => {
+ return await queryInterface.createTable('command-usages', {
+ id: {
+ type: Sequelize.INTEGER,
+ autoIncrement: true,
+ primaryKey: true
+ },
+ command: {
+ type: Sequelize.STRING,
+ allowNull: false
+ },
+ userID: {
+ type: Sequelize.STRING,
+ allowNull: false
+ },
+ guildID: {
+ type: Sequelize.STRING,
+ allowNull: true
+ },
+ createdAt: {
+ type: Sequelize.DATE
+ }
+ });
+};
+
+export const down = async (queryInterface) => {
+ return await queryInterface.dropTable('command-usages');
+};