-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
schema(WIP): add many-to-many to track user signups
part of a feature to keep track of users signing up for a specific launch time and: 1. getting notified via email when the lobby is open + how many signups are there / signed in users (still tbd) 2. visual indicator of number of total signups in that time slot refs virtualcommons/planning#63 Co-authored-by: Scott Foster <[email protected]> Co-authored-by: Sabrina Nelson <[email protected]>
- Loading branch information
1 parent
10c2f64
commit ccf18ae
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
server/src/migration/1702416761748-AddTournamentRoundSignupDates.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {MigrationInterface, QueryRunner} from "typeorm"; | ||
|
||
export class AddTournamentRoundSignupDates1702416761748 implements MigrationInterface { | ||
name = 'AddTournamentRoundSignupDates1702416761748' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`CREATE TABLE "tournament_round_date_signups_tournament_round_invite" ("tournamentRoundDateId" integer NOT NULL, "tournamentRoundInviteId" integer NOT NULL, CONSTRAINT "PK_ea476e541957d189cb43e5566fb" PRIMARY KEY ("tournamentRoundDateId", "tournamentRoundInviteId"))`); | ||
await queryRunner.query(`CREATE INDEX "IDX_179d52130a0f8722d72cfff0c5" ON "tournament_round_date_signups_tournament_round_invite" ("tournamentRoundDateId") `); | ||
await queryRunner.query(`CREATE INDEX "IDX_d78ddb4862cff6e11870e81ced" ON "tournament_round_date_signups_tournament_round_invite" ("tournamentRoundInviteId") `); | ||
await queryRunner.query(`ALTER TABLE "tournament_round_date_signups_tournament_round_invite" ADD CONSTRAINT "FK_179d52130a0f8722d72cfff0c5d" FOREIGN KEY ("tournamentRoundDateId") REFERENCES "tournament_round_date"("id") ON DELETE CASCADE ON UPDATE CASCADE`); | ||
await queryRunner.query(`ALTER TABLE "tournament_round_date_signups_tournament_round_invite" ADD CONSTRAINT "FK_d78ddb4862cff6e11870e81ced8" FOREIGN KEY ("tournamentRoundInviteId") REFERENCES "tournament_round_invite"("id") ON DELETE CASCADE ON UPDATE CASCADE`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "tournament_round_date_signups_tournament_round_invite" DROP CONSTRAINT "FK_d78ddb4862cff6e11870e81ced8"`); | ||
await queryRunner.query(`ALTER TABLE "tournament_round_date_signups_tournament_round_invite" DROP CONSTRAINT "FK_179d52130a0f8722d72cfff0c5d"`); | ||
await queryRunner.query(`DROP INDEX "public"."IDX_d78ddb4862cff6e11870e81ced"`); | ||
await queryRunner.query(`DROP INDEX "public"."IDX_179d52130a0f8722d72cfff0c5"`); | ||
await queryRunner.query(`DROP TABLE "tournament_round_date_signups_tournament_round_invite"`); | ||
} | ||
|
||
} |