sendou.ink/migrations/045-tournament-staff.js
Kalle e23e949980
Tournament staff (TO & Streamer) (#1619)
* Migrations

* Arrange admin UI

* Load staff from DB

* Fix TODO

* Can add/remove staff

* isTournamentAdmin / isTournamentOrganizer

* Show chat to streamer

* User titles in the chat

* chat name color

* Unique constraint

* TO Staff E2E tests

* Casts on stream page

* Streamer test

* Fix test
2024-01-07 12:41:03 +02:00

19 lines
547 B
JavaScript

module.exports.up = function (db) {
db.prepare(
/*sql*/ `
create table "TournamentStaff" (
"tournamentId" integer not null,
"userId" integer not null,
"role" text not null,
foreign key ("tournamentId") references "Tournament"("id") on delete cascade,
foreign key ("userId") references "User"("id") on delete cascade,
unique("tournamentId", "userId") on conflict rollback
) strict
`,
).run();
db.prepare(
/* sql */ `alter table "Tournament" add "castTwitchAccounts" text`,
).run();
};