Skip to content

Commit

Permalink
Bug fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaUrsa committed Feb 19, 2024
1 parent 0ea76b2 commit b826990
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"db:validateSchema": "docker exec -it tripbot npx prisma validate",
"db:generateClient": "npx prisma generate && docker exec -it tripbot npx prisma generate",
"db:pushDev": "docker exec -it tripbot npx prisma db push && npm run tripbot:db:generate",
"db:migrateDev": "docker exec -it tripbot npx prisma migrate dev -n ai_ui_fix",
"db:migrateDev": "docker exec -it tripbot npx prisma migrate dev -n welcome_fix",
"db:seed": "docker exec -it tripbot npx prisma db seed",
"## PGADMIN ##": "",
"pgadmin": "docker compose --project-name tripbot up -d --force-recreate --build tripbot_pgadmin",
Expand Down
3 changes: 2 additions & 1 deletion src/discord/events/guildMemberAdd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const F = f(__filename);
export const guildMemberAdd: GuildMemberAddEvent = {
name: 'guildMemberAdd',
async execute(member) {
await member.fetch(true);
const guildData = await db.discord_guilds.upsert({
where: {
id: member.guild.id,
Expand All @@ -26,7 +27,7 @@ export const guildMemberAdd: GuildMemberAddEvent = {
if (!guildData) return;

if (member.guild.id !== env.DISCORD_GUILD_ID) return;

Check failure on line 29 in src/discord/events/guildMemberAdd.ts

View workflow job for this annotation

GitHub Actions / Lint

Unnecessary return statement
await trust(member);
// await trust(member);
},
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-- CreateTable
CREATE TABLE "members" (
"id" TEXT NOT NULL,
"guild_id" TEXT NOT NULL,
"trusted" BOOLEAN NOT NULL DEFAULT false,

CONSTRAINT "members_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "members_id_guildid_unique" ON "members"("id", "guild_id");

-- AddForeignKey
ALTER TABLE "members" ADD CONSTRAINT "members_id_foreign" FOREIGN KEY ("id") REFERENCES "users"("discord_id") ON DELETE NO ACTION ON UPDATE NO ACTION;

-- AddForeignKey
ALTER TABLE "members" ADD CONSTRAINT "members_guildid_foreign" FOREIGN KEY ("guild_id") REFERENCES "discord_guilds"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;

0 comments on commit b826990

Please sign in to comment.