mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-07-30 15:53:59 -05:00
* YouTube lite embed + CSS bundled import * Migration initial * New VoD page initial functioning * Table changes + add TODOs * New structure for add vod page * WIP add new VoD backend * Merge branch 'rewrite' of https://github.com/Sendouc/sendou.ink into vods * Fix when leaderboard appears * Function new vod form * Single vod page initial * Different YouTubeEmbed * Scroll to top when going to timestamp * Vod match weapon/mode icons * Vod page user * Add date to vod page * Adjust migration order * Vod page many weapons * Add title to vod page * New vods page cast many weapons * Add player index to order by * Vods new more validation * Vod listing page initial * Vods page with filters * Show message if no vods * Fix not being to unset filters * Fix seed sometimes throwing errors * User page VoDs * Vods nullable weapon combobox * Link directly to user custom url from vod page * Make video adder admin action * Can add video checks * i18n * New VoD form tests * VoD operates filters test * Vods behind flag * Remove from config
71 lines
1.9 KiB
JavaScript
71 lines
1.9 KiB
JavaScript
module.exports.up = function (db) {
|
|
db.prepare(
|
|
`alter table "User" add column "isVideoAdder" integer default 0`
|
|
).run();
|
|
|
|
db.prepare(
|
|
/*sql*/ `
|
|
create table "UnvalidatedVideo" (
|
|
"id" integer primary key,
|
|
"title" text not null,
|
|
"type" text not null,
|
|
"youtubeId" text not null,
|
|
"youtubeDate" integer not null,
|
|
"submitterUserId" integer not null,
|
|
"validatedAt" integer,
|
|
"eventId" integer,
|
|
foreign key ("submitterUserId") references "User"("id") on delete restrict,
|
|
foreign key ("eventId") references "CalendarEvent"("id") on delete restrict
|
|
) strict
|
|
`
|
|
).run();
|
|
|
|
db.prepare(
|
|
`create index video_event_id on "UnvalidatedVideo"("eventId")`
|
|
).run();
|
|
|
|
db.prepare(
|
|
/*sql*/ `
|
|
create view "Video"
|
|
as
|
|
select * from "UnvalidatedVideo" where "validatedAt" is not null
|
|
`
|
|
).run();
|
|
|
|
db.prepare(
|
|
/*sql*/ `
|
|
create table "VideoMatch" (
|
|
"id" integer primary key,
|
|
"videoId" integer not null,
|
|
"startsAt" integer not null,
|
|
"stageId" integer not null,
|
|
"mode" text not null,
|
|
foreign key ("videoId") references "UnvalidatedVideo"("id") on delete cascade
|
|
) strict
|
|
`
|
|
).run();
|
|
db.prepare(
|
|
`create index video_match_video_id on "VideoMatch"("videoId")`
|
|
).run();
|
|
|
|
db.prepare(
|
|
/*sql*/ `
|
|
create table "VideoMatchPlayer" (
|
|
"videoMatchId" integer not null,
|
|
"playerUserId" integer,
|
|
"playerName" text,
|
|
"weaponSplId" integer not null,
|
|
"player" integer not null,
|
|
foreign key ("videoMatchId") references "VideoMatch"("id") on delete cascade,
|
|
foreign key ("playerUserId") references "User"("id") on delete restrict
|
|
) strict
|
|
`
|
|
).run();
|
|
db.prepare(
|
|
`create index video_match_player_video_match_id on "VideoMatchPlayer"("videoMatchId")`
|
|
).run();
|
|
db.prepare(
|
|
`create index video_match_player_player_user_id on "VideoMatchPlayer"("playerUserId")`
|
|
).run();
|
|
};
|