🏷️ fixed "wrong" types
This commit is contained in:
parent
ea8e3bb1dc
commit
98acf7ce57
4 changed files with 48 additions and 3 deletions
|
@ -0,0 +1,18 @@
|
||||||
|
-- RedefineTables
|
||||||
|
PRAGMA foreign_keys=OFF;
|
||||||
|
CREATE TABLE "new_Cooldown" (
|
||||||
|
"guildId" TEXT NOT NULL,
|
||||||
|
"userId" TEXT NOT NULL,
|
||||||
|
"cooldown" TEXT NOT NULL,
|
||||||
|
"timeoutId" TEXT NOT NULL,
|
||||||
|
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updatedAt" DATETIME NOT NULL,
|
||||||
|
CONSTRAINT "Cooldown_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT "Cooldown_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
INSERT INTO "new_Cooldown" ("cooldown", "createdAt", "guildId", "timeoutId", "updatedAt", "userId") SELECT "cooldown", "createdAt", "guildId", "timeoutId", "updatedAt", "userId" FROM "Cooldown";
|
||||||
|
DROP TABLE "Cooldown";
|
||||||
|
ALTER TABLE "new_Cooldown" RENAME TO "Cooldown";
|
||||||
|
CREATE UNIQUE INDEX "Cooldown_guildId_userId_timeoutId_key" ON "Cooldown"("guildId", "userId", "timeoutId");
|
||||||
|
PRAGMA foreign_key_check;
|
||||||
|
PRAGMA foreign_keys=ON;
|
24
prisma/migrations/20221020084922_cooldown_int/migration.sql
Normal file
24
prisma/migrations/20221020084922_cooldown_int/migration.sql
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- You are about to alter the column `cooldown` on the `Cooldown` table. The data in that column could be lost. The data in that column will be cast from `String` to `Int`.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- RedefineTables
|
||||||
|
PRAGMA foreign_keys=OFF;
|
||||||
|
CREATE TABLE "new_Cooldown" (
|
||||||
|
"guildId" TEXT NOT NULL,
|
||||||
|
"userId" TEXT NOT NULL,
|
||||||
|
"cooldown" INTEGER NOT NULL,
|
||||||
|
"timeoutId" TEXT NOT NULL,
|
||||||
|
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updatedAt" DATETIME NOT NULL,
|
||||||
|
CONSTRAINT "Cooldown_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT "Cooldown_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
INSERT INTO "new_Cooldown" ("cooldown", "createdAt", "guildId", "timeoutId", "updatedAt", "userId") SELECT "cooldown", "createdAt", "guildId", "timeoutId", "updatedAt", "userId" FROM "Cooldown";
|
||||||
|
DROP TABLE "Cooldown";
|
||||||
|
ALTER TABLE "new_Cooldown" RENAME TO "Cooldown";
|
||||||
|
CREATE UNIQUE INDEX "Cooldown_guildId_userId_timeoutId_key" ON "Cooldown"("guildId", "userId", "timeoutId");
|
||||||
|
PRAGMA foreign_key_check;
|
||||||
|
PRAGMA foreign_keys=ON;
|
|
@ -51,7 +51,10 @@ export default {
|
||||||
noSelfReputation(optionTarget, user);
|
noSelfReputation(optionTarget, user);
|
||||||
|
|
||||||
// Check if user is on cooldown otherwise create one
|
// Check if user is on cooldown otherwise create one
|
||||||
await CooldownCommand(interaction, process.env.REPUTATION_TIMEOUT);
|
await CooldownCommand(
|
||||||
|
interaction,
|
||||||
|
parseInt(process.env.REPUTATION_TIMEOUT)
|
||||||
|
);
|
||||||
|
|
||||||
switch (optionType) {
|
switch (optionType) {
|
||||||
case "positive": {
|
case "positive": {
|
||||||
|
|
4
src/types/common/environment.d.ts
vendored
4
src/types/common/environment.d.ts
vendored
|
@ -7,7 +7,7 @@ declare global {
|
||||||
DISCORD_TOKEN: string;
|
DISCORD_TOKEN: string;
|
||||||
DISCORD_CLIENT_ID: Snowflake;
|
DISCORD_CLIENT_ID: Snowflake;
|
||||||
DISCORD_GUILD_ID: Snowflake;
|
DISCORD_GUILD_ID: Snowflake;
|
||||||
DEVELOPMENT_MODE: boolean;
|
DEVELOPMENT_MODE: string;
|
||||||
ENCRYPTION_ALGORITHM: string;
|
ENCRYPTION_ALGORITHM: string;
|
||||||
ENCRYPTION_SECRET: string;
|
ENCRYPTION_SECRET: string;
|
||||||
EMBED_COLOR_SUCCESS: ColorResolvable;
|
EMBED_COLOR_SUCCESS: ColorResolvable;
|
||||||
|
@ -16,7 +16,7 @@ declare global {
|
||||||
EMBED_FOOTER_TEXT: string;
|
EMBED_FOOTER_TEXT: string;
|
||||||
EMBED_FOOTER_ICON: string;
|
EMBED_FOOTER_ICON: string;
|
||||||
LOG_LEVEL: string;
|
LOG_LEVEL: string;
|
||||||
REPUTATION_TIMEOUT: number;
|
REPUTATION_TIMEOUT: string;
|
||||||
BOT_HOSTER_NAME: string;
|
BOT_HOSTER_NAME: string;
|
||||||
BOT_HOSTER_URL: string;
|
BOT_HOSTER_URL: string;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue