aboutsummaryrefslogtreecommitdiff
path: root/bot/src/db/migrations/20250330202144-command-usages.js
blob: 095f817798e7d2a8baabd8eae279beea0905f646 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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');
};