aboutsummaryrefslogtreecommitdiff
path: root/src/lib/models/Global.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-01-08 20:08:16 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-01-08 20:08:16 -0500
commite0531157a745ac6178d55cc159b5932fa36ff20f (patch)
treea8de340d0c48269619e9bfde536932eb08556593 /src/lib/models/Global.ts
parent0e160ae77477f0986a02746e84158329299f438f (diff)
downloadtanzanite-e0531157a745ac6178d55cc159b5932fa36ff20f.tar.gz
tanzanite-e0531157a745ac6178d55cc159b5932fa36ff20f.tar.bz2
tanzanite-e0531157a745ac6178d55cc159b5932fa36ff20f.zip
database migrations - use jsonb over text + JSON.parse, refactor bad word & automod - store word in shared db
closes: #53
Diffstat (limited to 'src/lib/models/Global.ts')
-rw-r--r--src/lib/models/Global.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/models/Global.ts b/src/lib/models/Global.ts
index 1deb090..8e467f6 100644
--- a/src/lib/models/Global.ts
+++ b/src/lib/models/Global.ts
@@ -1,7 +1,6 @@
import { type Snowflake } from 'discord.js';
import { type Sequelize } from 'sequelize';
import { BaseModel } from './BaseModel.js';
-import { jsonArray } from './__helpers.js';
const { DataTypes } = (await import('sequelize')).default;
export interface GlobalModel {
@@ -54,10 +53,10 @@ export class Global extends BaseModel<GlobalModel, GlobalModelCreationAttributes
Global.init(
{
environment: { type: DataTypes.STRING, primaryKey: true },
- disabledCommands: jsonArray('disabledCommands'),
- blacklistedUsers: jsonArray('blacklistedUsers'),
- blacklistedGuilds: jsonArray('blacklistedGuilds'),
- blacklistedChannels: jsonArray('blacklistedChannels')
+ disabledCommands: { type: DataTypes.JSONB, allowNull: false, defaultValue: [] },
+ blacklistedUsers: { type: DataTypes.JSONB, allowNull: false, defaultValue: [] },
+ blacklistedGuilds: { type: DataTypes.JSONB, allowNull: false, defaultValue: [] },
+ blacklistedChannels: { type: DataTypes.JSONB, allowNull: false, defaultValue: [] }
},
{ sequelize }
);