diff --git a/app/db/seed.ts b/app/db/seed.ts index d65c4c4ed..b70c3e911 100644 --- a/app/db/seed.ts +++ b/app/db/seed.ts @@ -330,7 +330,7 @@ function calendarEvents() { "id", "name", "description", - "discordUrl", + "discordInviteCode", "bracketUrl", "authorId", "tags" @@ -338,7 +338,7 @@ function calendarEvents() { $id, $name, $description, - $discordUrl, + $discordInviteCode, $bracketUrl, $authorId, $tags @@ -351,7 +351,7 @@ function calendarEvents() { faker.word.noun() )}`, description: faker.lorem.paragraph(), - discordUrl: faker.internet.url(), + discordInviteCode: faker.lorem.word(), bracketUrl: faker.internet.url(), authorId: userIds.pop(), tags: diff --git a/app/db/types.ts b/app/db/types.ts index 67f8b96da..44ba83d3f 100644 --- a/app/db/types.ts +++ b/app/db/types.ts @@ -85,6 +85,8 @@ export interface CalendarEvent { authorId: number; tags?: string; description: string | null; + discordInviteCode: string | null; + // generated column discordUrl: string | null; bracketUrl: string; participantCount: number | null; diff --git a/app/routes/calendar/new.tsx b/app/routes/calendar/new.tsx index db1e47a64..ec6257b9c 100644 --- a/app/routes/calendar/new.tsx +++ b/app/routes/calendar/new.tsx @@ -180,8 +180,8 @@ function DatesInput() { function DiscordLinkInput() { return (
- - + +
); } diff --git a/migrations/006-calendar.js b/migrations/006-calendar.js index 079005261..2f2be5d9a 100644 --- a/migrations/006-calendar.js +++ b/migrations/006-calendar.js @@ -7,7 +7,8 @@ module.exports.up = function (db) { "authorId" integer not null, "bracketUrl" text not null, "description" text, - "discordUrl" text, + "discordInviteCode" text, + "discordUrl" text generated always as ('https://discord.gg/' || "discordInviteCode") virtual, "participantCount" integer, "tags" text, foreign key ("authorId") references "User"("id") on delete restrict