Restore production migration history
CI - Build & Verify / Build, Typecheck & Hygiene (push) Successful in 57s
CI - Build & Verify / Deploy to award.noveria.net (push) Failing after 56s

This commit is contained in:
AzuTear
2026-06-29 17:57:47 +02:00
parent 441ef2b850
commit 1a74c03621
58 changed files with 38994 additions and 944 deletions
+184
View File
@@ -0,0 +1,184 @@
namespace Backend.Data;
using Backend.Services;
internal sealed record AwardCategorySeed(string LegacyGroupName, string Name, string Slug, string Description, int SortOrder);
internal sealed record CandidateSeed(string CategorySlug, string DisplayName, string ChannelSlug, string Platform);
internal sealed record WinnerSeed(int Year, string CategorySlug, string DisplayName, string ChannelSlug, string Platform);
internal sealed record SiteFaqSeed(string Question, string Answer);
internal sealed record SiteSocialSeed(string Label, string Platform, string Url, string Icon);
internal sealed record SponsorSeed(string Name, string WebsiteUrl, string LogoUrl, string Description, string Tier, int SortOrder);
internal static class SeedCatalog
{
internal static readonly SeasonSubcategoryTemplateSetting[] DefaultSubcategoryTemplates =
[
new("Hidden Star", "hidden-star", 1, 1, 20),
new("Rising Star", "rising-star", 2, 21, 60),
new("Shining Star", "shining-star", 3, 61, null),
];
internal static readonly AwardCategorySeed[] AwardCategorySeeds =
[
new("Main Awards", "VTuber des Jahres", "vtuber-des-jahres", "Die größte Auszeichnung des Jahres.", 1),
new("Discovery", "Best Newcomer", "best-newcomer", "Neue Stimmen, neue Welten und frische Energie für die Szene.", 2),
new("Creative", "Model & Design", "model-design", "Live2D, 3D, Outfit, Rigging und visuelle Identitaet.", 3),
new("Performance", "Gesang & Musik", "gesang-musik", "Songs, Covers, Konzerte und musikalische Highlights.", 4),
new("Gaming", "Best Gaming", "best-gaming", "Gameplay, Skill, Chaos und legendaere Gaming-Momente.", 5),
new("Entertainment", "Best Variety", "best-variety", "Talk, Comedy, Watchalongs und kreative Streamformate.", 6),
new("Community", "Community Liebling", "community-liebling", "Creator:innen, die ihre Community besonders stark verbinden.", 7),
new("Collab", "Best Collab & Duo", "best-collab-duo", "Gemeinsame Streams, Projekte und Duo-Dynamik.", 8),
];
internal static readonly Dictionary<string, string> LegacyCategorySlugMap = new(StringComparer.OrdinalIgnoreCase)
{
["bestes-live-event"] = "best-newcomer",
["clip-des-jahres"] = "model-design",
["beste-community"] = "gesang-musik",
};
internal static readonly SiteFaqSeed[] SiteFaqSeeds =
[
new(
"Wer darf nominiert werden?",
"Jede:r aktive deutschsprachige VTuber kann nominiert werden — unabhaengig von Follower-Zahl oder Plattform. Die Community schlaegt in der Nominierungsphase ihre Favorit:innen vor."),
new(
"Wie funktioniert das Voting?",
"Du meldest dich ausschließlich mit deinem Twitch-Account an — nur so kannst du teilnehmen. Das hält das Voting fair und bot-frei. Danach vergibst du pro Kategorie eine Stimme, änderbar bis zum Ende der Phase."),
new(
"Was kostet die Teilnahme?",
"Gar nichts. Nominieren, voten und die Show schauen ist komplett kostenlos — der VTuber Star Award ist ein Community-Event von Fans für Fans."),
new(
"Wann und wo findet die Award-Show statt?",
"Die große Live-Show wird von Jayuhime gehostet und auf Twitch & YouTube gestreamt. Den genauen Termin findest du im Countdown oben — sei live dabei, wenn die Stars gekürt werden!"),
new(
"Ich wurde nominiert — was nun?",
"Glückwunsch! Du erhältst eine Benachrichtigung mit allen Infos. Teile deine Nominierung gern mit deiner Community und ruf zum Voten auf — jede Stimme zählt."),
];
internal static readonly SiteSocialSeed[] SiteSocialSeeds =
[
new("Twitch", "twitch", "https://twitch.tv/jayuhime", "twitch"),
new("YouTube", "youtube", "https://youtube.com/c/Jayuhime", "youtube"),
new("X", "x", "https://x.com/jayuhime", "x"),
new("Instagram", "instagram", "https://instagram.com/jayuhime", "instagram"),
new("Discord", "discord", "https://discord.gg/jayuhime", "discord"),
];
internal const string DefaultImprintContent = """
Anbieter
VTuber Star Awards, vertreten durch Jayuhime.
Kontakt
Nutze für organisatorische Fragen bitte die Kontaktseite oder die hinterlegte Kontaktadresse.
Hinweis
Dieses Impressum ist ein redaktioneller Platzhalter und sollte vor dem Livegang mit den tatsächlichen Anbieterangaben ersetzt werden.
""";
internal const string DefaultContactContent = """
Kontakt zum Award-Team
Du hast Fragen zur Nominierung, zum Voting, zu Clips oder zur Show? Schreib dem Team über die hinterlegte Kontaktseite.
Datenschutzfragen
Für Datenschutzanfragen nutze bitte die Datenschutz-E-Mail aus diesem Footer.
Community & Kooperationen
Social Links und Partneranfragen werden vom Admin-Team gepflegt und koordiniert.
""";
internal const string DefaultSponsorsContent = """
Sponsoren & Partner
Hier können Sponsor:innen, Medienpartner, Community-Partner und Supporter des VTuber Star Awards vorgestellt werden.
Partner werden im Rahmen der Show und auf den öffentlichen Kontaktflächen genannt, sobald sie final bestätigt sind.
""";
internal static readonly CandidateSeed[] CurrentCandidateSeeds =
[
new("vtuber-des-jahres-shining-star", "Hoshimi Miyu", "@hoshimimiyu", "Twitch"),
new("vtuber-des-jahres-shining-star", "Kurainu", "@kurainu", "Twitch"),
new("vtuber-des-jahres-shining-star", "Shiro Ch.", "@shiroch", "Twitch"),
new("best-newcomer-hidden-star", "Aoi Sakura", "@aoisakura", "YouTube"),
new("best-newcomer-rising-star", "Nox Live", "@noxlive", "Twitch"),
new("model-design-shining-star", "Velvet Rei", "@velvetrei", "Twitch"),
new("model-design-rising-star", "Mochi Atelier", "@mochiatelier", "Cake"),
new("gesang-musik-shining-star", "Melo Diva", "@melodiva", "YouTube"),
new("gesang-musik-rising-star", "Yuki Stern", "@yukistern", "Twitch"),
new("best-gaming-shining-star", "Kurainu", "@kurainu", "Twitch"),
new("best-gaming-rising-star", "PixelPunk", "@pixelpunk", "Twitch"),
new("best-variety-shining-star", "Taro Chaos", "@tarochaos", "Twitch"),
new("best-variety-rising-star", "Kotaro Plays", "@kotaroplays", "YouTube"),
new("community-liebling-shining-star", "Shiro Ch.", "@shiroch", "Twitch"),
new("community-liebling-hidden-star", "Lumi", "@lumi_vt", "Cake"),
new("best-collab-duo-shining-star", "Akari & Nox", "@akari_vt", "Twitch"),
new("best-collab-duo-rising-star", "Mochi & Hana", "@mochi_mochi", "YouTube"),
];
internal static readonly WinnerSeed[] WinnerSeeds =
[
new(2025, "vtuber-des-jahres-shining-star", "Hoshimi Miyu", "@hoshimimiyu", "Twitch"),
new(2025, "best-newcomer-hidden-star", "Aoi Sakura", "@aoisakura", "YouTube"),
new(2025, "model-design-shining-star", "Velvet Rei", "@velvetrei", "Twitch"),
new(2025, "gesang-musik-shining-star", "Melo Diva", "@melodiva", "YouTube"),
new(2025, "best-gaming-shining-star", "Kurainu", "@kurainu", "Twitch"),
new(2025, "best-variety-shining-star", "Taro Chaos", "@tarochaos", "Twitch"),
new(2025, "community-liebling-shining-star", "Shiro Ch.", "@shiroch", "Twitch"),
new(2025, "best-collab-duo-shining-star", "Akari & Nox", "@akari_vt", "Cake"),
new(2024, "vtuber-des-jahres-shining-star", "Aoi Sakura", "@aoisakura", "YouTube"),
new(2024, "best-newcomer-hidden-star", "Lumi", "@lumi_vt", "Cake"),
new(2024, "model-design-rising-star", "Mochi Atelier", "@mochiatelier", "Cake"),
new(2024, "gesang-musik-rising-star", "Yuki Stern", "@yukistern", "Twitch"),
new(2024, "best-gaming-shining-star", "Starbyte", "@starbyte", "Twitch"),
new(2024, "best-variety-rising-star", "Kotaro Plays", "@kotaroplays", "YouTube"),
new(2024, "community-liebling-rising-star", "Moonrelay", "@moonrelay", "Twitch"),
new(2024, "best-collab-duo-rising-star", "Pixel & Kotaro", "@pixelpunk", "Twitch"),
new(2023, "vtuber-des-jahres-shining-star", "Akari Nova", "@akarinova", "Twitch"),
new(2023, "best-newcomer-rising-star", "Nox Live", "@noxlive", "Twitch"),
new(2023, "model-design-shining-star", "Rei Velvet", "@reivelvet", "YouTube"),
new(2023, "gesang-musik-shining-star", "Tenshi Vox", "@tenshivox", "Twitch"),
new(2023, "best-gaming-rising-star", "Bit Knight", "@bitknight", "Twitch"),
new(2023, "best-variety-hidden-star", "Hana Hearts", "@hanahearts", "Cake"),
new(2023, "community-liebling-rising-star", "Sora Blau", "@sorablau", "YouTube"),
new(2023, "best-collab-duo-rising-star", "Yuki & Melo", "@yukistern", "Twitch"),
];
internal static readonly SponsorSeed[] DemoSponsorSeeds =
[
new(
"HoshiForge Studio",
"https://hoshiforge.example",
"/demo/sponsors/hoshiforge-studio.svg",
"Branding-, Overlay- und Debuet-Visuals fuer VTuber-Projekte und Community-Events.",
"Presenting Sponsor",
10),
new(
"NekoPixel Energy",
"https://nekopixel.example",
"/demo/sponsors/nekopixel-energy.svg",
"Community-fokussierter Drink-Partner fuer lange Showabende, Watchpartys und Creator-Collabs.",
"Gold Partner",
20),
new(
"PrismLoop Audio",
"https://prismloop.example",
"/demo/sponsors/prismloop-audio.svg",
"Audio-Tools, Intro-Packs und Stream-Sounddesign fuer Live-Shows und Highlight-Clips.",
"Gold Partner",
30),
new(
"CloudBeacon Hosting",
"https://cloudbeacon.example",
"/demo/sponsors/cloudbeacon-hosting.svg",
"Skalierbares Hosting fuer Voting, Landingpages und Event-Traffic rund um Showtage.",
"Tech Partner",
40),
new(
"ChibiCanvas Market",
"https://chibicanvas.example",
"/demo/sponsors/chibicanvas-market.svg",
"Merch-, Sticker- und Artist-Marketplace mit Fokus auf VTuber, Emotes und Fanartikel.",
"Community Partner",
50),
];
}
@@ -0,0 +1,833 @@
// <auto-generated />
using System;
using Backend.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Backend.Migrations
{
[DbContext(typeof(AwardsDbContext))]
[Migration("20260617060000_InitialCreate")]
partial class InitialCreate
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.11")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Backend.Domain.AwardResult", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("CandidateId")
.HasColumnType("integer");
b.Property<string>("CategoryName")
.IsRequired()
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.Property<int>("SeasonId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("CandidateId");
b.HasIndex("SeasonId");
b.ToTable("Results");
b.HasData(
new
{
Id = 1,
CandidateId = 8,
CategoryName = "VTuber des Jahres",
SeasonId = 2
},
new
{
Id = 2,
CandidateId = 9,
CategoryName = "Bestes Live Event",
SeasonId = 2
},
new
{
Id = 3,
CandidateId = 10,
CategoryName = "Clip des Jahres",
SeasonId = 2
},
new
{
Id = 4,
CandidateId = 11,
CategoryName = "VTuber des Jahres",
SeasonId = 3
},
new
{
Id = 5,
CandidateId = 12,
CategoryName = "Clip des Jahres",
SeasonId = 3
},
new
{
Id = 6,
CandidateId = 13,
CategoryName = "VTuber des Jahres",
SeasonId = 4
});
});
modelBuilder.Entity("Backend.Domain.Candidate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("CategoryId")
.HasColumnType("integer");
b.Property<string>("ChannelSlug")
.IsRequired()
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.Property<string>("Platform")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("character varying(40)");
b.Property<int>("SeasonId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("CategoryId");
b.HasIndex("SeasonId");
b.ToTable("Candidates");
b.HasData(
new
{
Id = 1,
CategoryId = 1,
ChannelSlug = "@hoshimimiyu",
DisplayName = "Hoshimi Miyu",
Platform = "Twitch",
SeasonId = 1
},
new
{
Id = 2,
CategoryId = 1,
ChannelSlug = "@kurainu",
DisplayName = "Kurainu",
Platform = "Twitch",
SeasonId = 1
},
new
{
Id = 3,
CategoryId = 1,
ChannelSlug = "@shiroch",
DisplayName = "Shiro Ch.",
Platform = "Twitch",
SeasonId = 1
},
new
{
Id = 4,
CategoryId = 2,
ChannelSlug = "@kurainu",
DisplayName = "Kurainu 3D Live",
Platform = "Twitch",
SeasonId = 1
},
new
{
Id = 5,
CategoryId = 2,
ChannelSlug = "@aoisakura",
DisplayName = "Aoi Sakura Showcase",
Platform = "YouTube",
SeasonId = 1
},
new
{
Id = 6,
CategoryId = 3,
ChannelSlug = "@pyonkichikingdom",
DisplayName = "Pyonkichi Kingdom",
Platform = "Twitch",
SeasonId = 1
},
new
{
Id = 7,
CategoryId = 4,
ChannelSlug = "@moonrelay",
DisplayName = "Moonrelay",
Platform = "Twitch",
SeasonId = 1
},
new
{
Id = 8,
CategoryId = 5,
ChannelSlug = "@hoshimimiyu",
DisplayName = "Hoshimi Miyu",
Platform = "Twitch",
SeasonId = 2
},
new
{
Id = 9,
CategoryId = 6,
ChannelSlug = "@kurainu",
DisplayName = "Kurainu 3D Live",
Platform = "Twitch",
SeasonId = 2
},
new
{
Id = 10,
CategoryId = 7,
ChannelSlug = "@pyonkichikingdom",
DisplayName = "Pyonkichi Kingdom",
Platform = "Twitch",
SeasonId = 2
},
new
{
Id = 11,
CategoryId = 8,
ChannelSlug = "@aoisakura",
DisplayName = "Aoi Sakura",
Platform = "YouTube",
SeasonId = 3
},
new
{
Id = 12,
CategoryId = 9,
ChannelSlug = "@starbyte",
DisplayName = "Starbyte",
Platform = "Twitch",
SeasonId = 3
},
new
{
Id = 13,
CategoryId = 10,
ChannelSlug = "@tenshivox",
DisplayName = "Tenshi Vox",
Platform = "Twitch",
SeasonId = 4
});
});
modelBuilder.Entity("Backend.Domain.Category", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("character varying(400)");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(80)
.HasColumnType("character varying(80)");
b.Property<int>("MaxNomineesPerUser")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.Property<int>("SeasonId")
.HasColumnType("integer");
b.Property<string>("Slug")
.IsRequired()
.HasColumnType("text");
b.Property<int>("SortOrder")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("SeasonId", "Slug")
.IsUnique();
b.ToTable("Categories");
b.HasData(
new
{
Id = 1,
Description = "Die groesste Auszeichnung des Jahres.",
GroupName = "Main Awards",
MaxNomineesPerUser = 3,
Name = "VTuber des Jahres",
SeasonId = 1,
Slug = "vtuber-des-jahres",
SortOrder = 1
},
new
{
Id = 2,
Description = "Events, Konzerte und 3D-Shows.",
GroupName = "Performance",
MaxNomineesPerUser = 3,
Name = "Bestes Live Event",
SeasonId = 1,
Slug = "bestes-live-event",
SortOrder = 2
},
new
{
Id = 3,
Description = "Der lustigste oder emotionalste Clip des Jahres.",
GroupName = "Clips & Highlights",
MaxNomineesPerUser = 3,
Name = "Clip des Jahres",
SeasonId = 1,
Slug = "clip-des-jahres",
SortOrder = 3
},
new
{
Id = 4,
Description = "Die aktivste und freundlichste Community.",
GroupName = "Main Awards",
MaxNomineesPerUser = 3,
Name = "Beste Community",
SeasonId = 1,
Slug = "beste-community",
SortOrder = 4
},
new
{
Id = 5,
Description = "Archivkategorie 2025.",
GroupName = "Main Awards",
MaxNomineesPerUser = 3,
Name = "VTuber des Jahres",
SeasonId = 2,
Slug = "vtuber-des-jahres",
SortOrder = 1
},
new
{
Id = 6,
Description = "Archivkategorie 2025.",
GroupName = "Performance",
MaxNomineesPerUser = 3,
Name = "Bestes Live Event",
SeasonId = 2,
Slug = "bestes-live-event",
SortOrder = 2
},
new
{
Id = 7,
Description = "Archivkategorie 2025.",
GroupName = "Clips & Highlights",
MaxNomineesPerUser = 3,
Name = "Clip des Jahres",
SeasonId = 2,
Slug = "clip-des-jahres",
SortOrder = 3
},
new
{
Id = 8,
Description = "Archivkategorie 2024.",
GroupName = "Main Awards",
MaxNomineesPerUser = 3,
Name = "VTuber des Jahres",
SeasonId = 3,
Slug = "vtuber-des-jahres",
SortOrder = 1
},
new
{
Id = 9,
Description = "Archivkategorie 2024.",
GroupName = "Clips & Highlights",
MaxNomineesPerUser = 3,
Name = "Clip des Jahres",
SeasonId = 3,
Slug = "clip-des-jahres",
SortOrder = 2
},
new
{
Id = 10,
Description = "Archivkategorie 2023.",
GroupName = "Main Awards",
MaxNomineesPerUser = 3,
Name = "VTuber des Jahres",
SeasonId = 4,
Slug = "vtuber-des-jahres",
SortOrder = 1
});
});
modelBuilder.Entity("Backend.Domain.Nomination", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int?>("CandidateId")
.HasColumnType("integer");
b.Property<string>("CandidateText")
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.Property<int>("CategoryId")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int>("SeasonId")
.HasColumnType("integer");
b.Property<string>("SubmittedByTwitchId")
.IsRequired()
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.HasKey("Id");
b.HasIndex("CandidateId");
b.HasIndex("CategoryId");
b.HasIndex("SeasonId");
b.ToTable("Nominations");
b.HasData(
new
{
Id = 1,
CandidateText = "Hoshimi Miyu",
CategoryId = 1,
CreatedAt = new DateTimeOffset(new DateTime(2026, 6, 10, 13, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
SeasonId = 1,
SubmittedByTwitchId = "twitch_hoshi"
},
new
{
Id = 2,
CandidateText = "Kurainu 3D Live",
CategoryId = 2,
CreatedAt = new DateTimeOffset(new DateTime(2026, 6, 10, 14, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
SeasonId = 1,
SubmittedByTwitchId = "twitch_kurainu"
});
});
modelBuilder.Entity("Backend.Domain.Season", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("CurrentPhase")
.IsRequired()
.HasMaxLength(60)
.HasColumnType("character varying(60)");
b.Property<bool>("IsCommunityOnly")
.HasColumnType("boolean");
b.Property<bool>("IsCurrent")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(160)
.HasColumnType("character varying(160)");
b.Property<DateOnly>("NominationEndsAt")
.HasColumnType("date");
b.Property<DateOnly>("NominationStartsAt")
.HasColumnType("date");
b.Property<DateOnly>("ReviewEndsAt")
.HasColumnType("date");
b.Property<DateOnly>("ReviewStartsAt")
.HasColumnType("date");
b.Property<DateOnly>("ShowDate")
.HasColumnType("date");
b.Property<DateOnly>("VotingEndsAt")
.HasColumnType("date");
b.Property<DateOnly>("VotingStartsAt")
.HasColumnType("date");
b.Property<int>("Year")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("Year")
.IsUnique();
b.ToTable("Seasons");
b.HasData(
new
{
Id = 1,
CurrentPhase = "Community Voting",
IsCommunityOnly = true,
IsCurrent = true,
Name = "VTuber Star Awards 2026",
NominationEndsAt = new DateOnly(2026, 5, 31),
NominationStartsAt = new DateOnly(2026, 5, 1),
ReviewEndsAt = new DateOnly(2026, 7, 10),
ReviewStartsAt = new DateOnly(2026, 7, 1),
ShowDate = new DateOnly(2026, 7, 20),
VotingEndsAt = new DateOnly(2026, 6, 30),
VotingStartsAt = new DateOnly(2026, 6, 1),
Year = 2026
},
new
{
Id = 2,
CurrentPhase = "Archived",
IsCommunityOnly = true,
IsCurrent = false,
Name = "VTuber Star Awards 2025",
NominationEndsAt = new DateOnly(2025, 5, 31),
NominationStartsAt = new DateOnly(2025, 5, 1),
ReviewEndsAt = new DateOnly(2025, 7, 10),
ReviewStartsAt = new DateOnly(2025, 7, 1),
ShowDate = new DateOnly(2025, 7, 20),
VotingEndsAt = new DateOnly(2025, 6, 30),
VotingStartsAt = new DateOnly(2025, 6, 1),
Year = 2025
},
new
{
Id = 3,
CurrentPhase = "Archived",
IsCommunityOnly = true,
IsCurrent = false,
Name = "VTuber Star Awards 2024",
NominationEndsAt = new DateOnly(2024, 5, 31),
NominationStartsAt = new DateOnly(2024, 5, 1),
ReviewEndsAt = new DateOnly(2024, 7, 10),
ReviewStartsAt = new DateOnly(2024, 7, 1),
ShowDate = new DateOnly(2024, 7, 20),
VotingEndsAt = new DateOnly(2024, 6, 30),
VotingStartsAt = new DateOnly(2024, 6, 1),
Year = 2024
},
new
{
Id = 4,
CurrentPhase = "Archived",
IsCommunityOnly = true,
IsCurrent = false,
Name = "VTuber Star Awards 2023",
NominationEndsAt = new DateOnly(2023, 5, 31),
NominationStartsAt = new DateOnly(2023, 5, 1),
ReviewEndsAt = new DateOnly(2023, 7, 10),
ReviewStartsAt = new DateOnly(2023, 7, 1),
ShowDate = new DateOnly(2023, 7, 20),
VotingEndsAt = new DateOnly(2023, 6, 30),
VotingStartsAt = new DateOnly(2023, 6, 1),
Year = 2023
});
});
modelBuilder.Entity("Backend.Domain.VoteBallot", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("SeasonId")
.HasColumnType("integer");
b.Property<string>("Status")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<DateTimeOffset>("SubmittedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("SubmittedByTwitchId")
.IsRequired()
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.HasKey("Id");
b.HasIndex("SeasonId");
b.ToTable("VoteBallots");
b.HasData(
new
{
Id = 1,
SeasonId = 1,
Status = "submitted",
SubmittedAt = new DateTimeOffset(new DateTime(2026, 6, 11, 12, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
SubmittedByTwitchId = "twitch_vote_1"
},
new
{
Id = 2,
SeasonId = 1,
Status = "submitted",
SubmittedAt = new DateTimeOffset(new DateTime(2026, 6, 11, 12, 5, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
SubmittedByTwitchId = "twitch_vote_2"
});
});
modelBuilder.Entity("Backend.Domain.VoteEntry", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("BallotId")
.HasColumnType("integer");
b.Property<int>("CandidateId")
.HasColumnType("integer");
b.Property<int>("CategoryId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("BallotId");
b.HasIndex("CandidateId");
b.HasIndex("CategoryId");
b.ToTable("VoteEntries");
b.HasData(
new
{
Id = 1,
BallotId = 1,
CandidateId = 1,
CategoryId = 1
},
new
{
Id = 2,
BallotId = 1,
CandidateId = 4,
CategoryId = 2
},
new
{
Id = 3,
BallotId = 2,
CandidateId = 2,
CategoryId = 1
},
new
{
Id = 4,
BallotId = 2,
CandidateId = 6,
CategoryId = 3
});
});
modelBuilder.Entity("Backend.Domain.AwardResult", b =>
{
b.HasOne("Backend.Domain.Candidate", "Candidate")
.WithMany()
.HasForeignKey("CandidateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Backend.Domain.Season", "Season")
.WithMany("Results")
.HasForeignKey("SeasonId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Candidate");
b.Navigation("Season");
});
modelBuilder.Entity("Backend.Domain.Candidate", b =>
{
b.HasOne("Backend.Domain.Category", "Category")
.WithMany("Candidates")
.HasForeignKey("CategoryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Backend.Domain.Season", "Season")
.WithMany()
.HasForeignKey("SeasonId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Category");
b.Navigation("Season");
});
modelBuilder.Entity("Backend.Domain.Category", b =>
{
b.HasOne("Backend.Domain.Season", "Season")
.WithMany("Categories")
.HasForeignKey("SeasonId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Season");
});
modelBuilder.Entity("Backend.Domain.Nomination", b =>
{
b.HasOne("Backend.Domain.Candidate", "Candidate")
.WithMany()
.HasForeignKey("CandidateId");
b.HasOne("Backend.Domain.Category", "Category")
.WithMany()
.HasForeignKey("CategoryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Backend.Domain.Season", "Season")
.WithMany()
.HasForeignKey("SeasonId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Candidate");
b.Navigation("Category");
b.Navigation("Season");
});
modelBuilder.Entity("Backend.Domain.VoteBallot", b =>
{
b.HasOne("Backend.Domain.Season", "Season")
.WithMany()
.HasForeignKey("SeasonId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Season");
});
modelBuilder.Entity("Backend.Domain.VoteEntry", b =>
{
b.HasOne("Backend.Domain.VoteBallot", "Ballot")
.WithMany("Entries")
.HasForeignKey("BallotId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Backend.Domain.Candidate", "Candidate")
.WithMany()
.HasForeignKey("CandidateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Backend.Domain.Category", "Category")
.WithMany()
.HasForeignKey("CategoryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Ballot");
b.Navigation("Candidate");
b.Navigation("Category");
});
modelBuilder.Entity("Backend.Domain.Category", b =>
{
b.Navigation("Candidates");
});
modelBuilder.Entity("Backend.Domain.Season", b =>
{
b.Navigation("Categories");
b.Navigation("Results");
});
modelBuilder.Entity("Backend.Domain.VoteBallot", b =>
{
b.Navigation("Entries");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,395 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class InitialCreate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Seasons",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Year = table.Column<int>(type: "integer", nullable: false),
Name = table.Column<string>(type: "character varying(160)", maxLength: 160, nullable: false),
IsCurrent = table.Column<bool>(type: "boolean", nullable: false),
IsCommunityOnly = table.Column<bool>(type: "boolean", nullable: false),
CurrentPhase = table.Column<string>(type: "character varying(60)", maxLength: 60, nullable: false),
NominationStartsAt = table.Column<DateOnly>(type: "date", nullable: false),
NominationEndsAt = table.Column<DateOnly>(type: "date", nullable: false),
VotingStartsAt = table.Column<DateOnly>(type: "date", nullable: false),
VotingEndsAt = table.Column<DateOnly>(type: "date", nullable: false),
ReviewStartsAt = table.Column<DateOnly>(type: "date", nullable: false),
ReviewEndsAt = table.Column<DateOnly>(type: "date", nullable: false),
ShowDate = table.Column<DateOnly>(type: "date", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Seasons", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Categories",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SeasonId = table.Column<int>(type: "integer", nullable: false),
GroupName = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
Name = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
Slug = table.Column<string>(type: "text", nullable: false),
Description = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
SortOrder = table.Column<int>(type: "integer", nullable: false),
MaxNomineesPerUser = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Categories", x => x.Id);
table.ForeignKey(
name: "FK_Categories_Seasons_SeasonId",
column: x => x.SeasonId,
principalTable: "Seasons",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "VoteBallots",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SeasonId = table.Column<int>(type: "integer", nullable: false),
SubmittedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
Status = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
SubmittedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_VoteBallots", x => x.Id);
table.ForeignKey(
name: "FK_VoteBallots_Seasons_SeasonId",
column: x => x.SeasonId,
principalTable: "Seasons",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Candidates",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SeasonId = table.Column<int>(type: "integer", nullable: false),
CategoryId = table.Column<int>(type: "integer", nullable: false),
DisplayName = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
ChannelSlug = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
Platform = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Candidates", x => x.Id);
table.ForeignKey(
name: "FK_Candidates_Categories_CategoryId",
column: x => x.CategoryId,
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Candidates_Seasons_SeasonId",
column: x => x.SeasonId,
principalTable: "Seasons",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Nominations",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SeasonId = table.Column<int>(type: "integer", nullable: false),
CategoryId = table.Column<int>(type: "integer", nullable: false),
SubmittedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
CandidateId = table.Column<int>(type: "integer", nullable: true),
CandidateText = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Nominations", x => x.Id);
table.ForeignKey(
name: "FK_Nominations_Candidates_CandidateId",
column: x => x.CandidateId,
principalTable: "Candidates",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Nominations_Categories_CategoryId",
column: x => x.CategoryId,
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Nominations_Seasons_SeasonId",
column: x => x.SeasonId,
principalTable: "Seasons",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Results",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SeasonId = table.Column<int>(type: "integer", nullable: false),
CandidateId = table.Column<int>(type: "integer", nullable: false),
CategoryName = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Results", x => x.Id);
table.ForeignKey(
name: "FK_Results_Candidates_CandidateId",
column: x => x.CandidateId,
principalTable: "Candidates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Results_Seasons_SeasonId",
column: x => x.SeasonId,
principalTable: "Seasons",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "VoteEntries",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
BallotId = table.Column<int>(type: "integer", nullable: false),
CategoryId = table.Column<int>(type: "integer", nullable: false),
CandidateId = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_VoteEntries", x => x.Id);
table.ForeignKey(
name: "FK_VoteEntries_Candidates_CandidateId",
column: x => x.CandidateId,
principalTable: "Candidates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_VoteEntries_Categories_CategoryId",
column: x => x.CategoryId,
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_VoteEntries_VoteBallots_BallotId",
column: x => x.BallotId,
principalTable: "VoteBallots",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.InsertData(
table: "Seasons",
columns: new[] { "Id", "CurrentPhase", "IsCommunityOnly", "IsCurrent", "Name", "NominationEndsAt", "NominationStartsAt", "ReviewEndsAt", "ReviewStartsAt", "ShowDate", "VotingEndsAt", "VotingStartsAt", "Year" },
values: new object[,]
{
{ 1, "Community Voting", true, true, "VTuber Star Awards 2026", new DateOnly(2026, 5, 31), new DateOnly(2026, 5, 1), new DateOnly(2026, 7, 10), new DateOnly(2026, 7, 1), new DateOnly(2026, 7, 20), new DateOnly(2026, 6, 30), new DateOnly(2026, 6, 1), 2026 },
{ 2, "Archived", true, false, "VTuber Star Awards 2025", new DateOnly(2025, 5, 31), new DateOnly(2025, 5, 1), new DateOnly(2025, 7, 10), new DateOnly(2025, 7, 1), new DateOnly(2025, 7, 20), new DateOnly(2025, 6, 30), new DateOnly(2025, 6, 1), 2025 },
{ 3, "Archived", true, false, "VTuber Star Awards 2024", new DateOnly(2024, 5, 31), new DateOnly(2024, 5, 1), new DateOnly(2024, 7, 10), new DateOnly(2024, 7, 1), new DateOnly(2024, 7, 20), new DateOnly(2024, 6, 30), new DateOnly(2024, 6, 1), 2024 },
{ 4, "Archived", true, false, "VTuber Star Awards 2023", new DateOnly(2023, 5, 31), new DateOnly(2023, 5, 1), new DateOnly(2023, 7, 10), new DateOnly(2023, 7, 1), new DateOnly(2023, 7, 20), new DateOnly(2023, 6, 30), new DateOnly(2023, 6, 1), 2023 }
});
migrationBuilder.InsertData(
table: "Categories",
columns: new[] { "Id", "Description", "GroupName", "MaxNomineesPerUser", "Name", "SeasonId", "Slug", "SortOrder" },
values: new object[,]
{
{ 1, "Die groesste Auszeichnung des Jahres.", "Main Awards", 3, "VTuber des Jahres", 1, "vtuber-des-jahres", 1 },
{ 2, "Events, Konzerte und 3D-Shows.", "Performance", 3, "Bestes Live Event", 1, "bestes-live-event", 2 },
{ 3, "Der lustigste oder emotionalste Clip des Jahres.", "Clips & Highlights", 3, "Clip des Jahres", 1, "clip-des-jahres", 3 },
{ 4, "Die aktivste und freundlichste Community.", "Main Awards", 3, "Beste Community", 1, "beste-community", 4 },
{ 5, "Archivkategorie 2025.", "Main Awards", 3, "VTuber des Jahres", 2, "vtuber-des-jahres", 1 },
{ 6, "Archivkategorie 2025.", "Performance", 3, "Bestes Live Event", 2, "bestes-live-event", 2 },
{ 7, "Archivkategorie 2025.", "Clips & Highlights", 3, "Clip des Jahres", 2, "clip-des-jahres", 3 },
{ 8, "Archivkategorie 2024.", "Main Awards", 3, "VTuber des Jahres", 3, "vtuber-des-jahres", 1 },
{ 9, "Archivkategorie 2024.", "Clips & Highlights", 3, "Clip des Jahres", 3, "clip-des-jahres", 2 },
{ 10, "Archivkategorie 2023.", "Main Awards", 3, "VTuber des Jahres", 4, "vtuber-des-jahres", 1 }
});
migrationBuilder.InsertData(
table: "VoteBallots",
columns: new[] { "Id", "SeasonId", "Status", "SubmittedAt", "SubmittedByTwitchId" },
values: new object[,]
{
{ 1, 1, "submitted", new DateTimeOffset(new DateTime(2026, 6, 11, 12, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), "twitch_vote_1" },
{ 2, 1, "submitted", new DateTimeOffset(new DateTime(2026, 6, 11, 12, 5, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), "twitch_vote_2" }
});
migrationBuilder.InsertData(
table: "Candidates",
columns: new[] { "Id", "CategoryId", "ChannelSlug", "DisplayName", "Platform", "SeasonId" },
values: new object[,]
{
{ 1, 1, "@hoshimimiyu", "Hoshimi Miyu", "Twitch", 1 },
{ 2, 1, "@kurainu", "Kurainu", "Twitch", 1 },
{ 3, 1, "@shiroch", "Shiro Ch.", "Twitch", 1 },
{ 4, 2, "@kurainu", "Kurainu 3D Live", "Twitch", 1 },
{ 5, 2, "@aoisakura", "Aoi Sakura Showcase", "YouTube", 1 },
{ 6, 3, "@pyonkichikingdom", "Pyonkichi Kingdom", "Twitch", 1 },
{ 7, 4, "@moonrelay", "Moonrelay", "Twitch", 1 },
{ 8, 5, "@hoshimimiyu", "Hoshimi Miyu", "Twitch", 2 },
{ 9, 6, "@kurainu", "Kurainu 3D Live", "Twitch", 2 },
{ 10, 7, "@pyonkichikingdom", "Pyonkichi Kingdom", "Twitch", 2 },
{ 11, 8, "@aoisakura", "Aoi Sakura", "YouTube", 3 },
{ 12, 9, "@starbyte", "Starbyte", "Twitch", 3 },
{ 13, 10, "@tenshivox", "Tenshi Vox", "Twitch", 4 }
});
migrationBuilder.InsertData(
table: "Nominations",
columns: new[] { "Id", "CandidateId", "CandidateText", "CategoryId", "CreatedAt", "SeasonId", "SubmittedByTwitchId" },
values: new object[,]
{
{ 1, null, "Hoshimi Miyu", 1, new DateTimeOffset(new DateTime(2026, 6, 10, 13, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 1, "twitch_hoshi" },
{ 2, null, "Kurainu 3D Live", 2, new DateTimeOffset(new DateTime(2026, 6, 10, 14, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), 1, "twitch_kurainu" }
});
migrationBuilder.InsertData(
table: "Results",
columns: new[] { "Id", "CandidateId", "CategoryName", "SeasonId" },
values: new object[,]
{
{ 1, 8, "VTuber des Jahres", 2 },
{ 2, 9, "Bestes Live Event", 2 },
{ 3, 10, "Clip des Jahres", 2 },
{ 4, 11, "VTuber des Jahres", 3 },
{ 5, 12, "Clip des Jahres", 3 },
{ 6, 13, "VTuber des Jahres", 4 }
});
migrationBuilder.InsertData(
table: "VoteEntries",
columns: new[] { "Id", "BallotId", "CandidateId", "CategoryId" },
values: new object[,]
{
{ 1, 1, 1, 1 },
{ 2, 1, 4, 2 },
{ 3, 2, 2, 1 },
{ 4, 2, 6, 3 }
});
migrationBuilder.CreateIndex(
name: "IX_Candidates_CategoryId",
table: "Candidates",
column: "CategoryId");
migrationBuilder.CreateIndex(
name: "IX_Candidates_SeasonId",
table: "Candidates",
column: "SeasonId");
migrationBuilder.CreateIndex(
name: "IX_Categories_SeasonId_Slug",
table: "Categories",
columns: new[] { "SeasonId", "Slug" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Nominations_CandidateId",
table: "Nominations",
column: "CandidateId");
migrationBuilder.CreateIndex(
name: "IX_Nominations_CategoryId",
table: "Nominations",
column: "CategoryId");
migrationBuilder.CreateIndex(
name: "IX_Nominations_SeasonId",
table: "Nominations",
column: "SeasonId");
migrationBuilder.CreateIndex(
name: "IX_Results_CandidateId",
table: "Results",
column: "CandidateId");
migrationBuilder.CreateIndex(
name: "IX_Results_SeasonId",
table: "Results",
column: "SeasonId");
migrationBuilder.CreateIndex(
name: "IX_Seasons_Year",
table: "Seasons",
column: "Year",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_VoteBallots_SeasonId",
table: "VoteBallots",
column: "SeasonId");
migrationBuilder.CreateIndex(
name: "IX_VoteEntries_BallotId",
table: "VoteEntries",
column: "BallotId");
migrationBuilder.CreateIndex(
name: "IX_VoteEntries_CandidateId",
table: "VoteEntries",
column: "CandidateId");
migrationBuilder.CreateIndex(
name: "IX_VoteEntries_CategoryId",
table: "VoteEntries",
column: "CategoryId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Nominations");
migrationBuilder.DropTable(
name: "Results");
migrationBuilder.DropTable(
name: "VoteEntries");
migrationBuilder.DropTable(
name: "Candidates");
migrationBuilder.DropTable(
name: "VoteBallots");
migrationBuilder.DropTable(
name: "Categories");
migrationBuilder.DropTable(
name: "Seasons");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,42 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddClipReviewWorkflow : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
"""
ALTER TABLE IF EXISTS "ClipSubmissions"
ADD COLUMN IF NOT EXISTS "ReviewNote" character varying(500) NULL;
ALTER TABLE IF EXISTS "ClipSubmissions"
ADD COLUMN IF NOT EXISTS "ReviewedByTwitchId" character varying(120) NULL;
ALTER TABLE IF EXISTS "ClipSubmissions"
ADD COLUMN IF NOT EXISTS "ReviewedAt" timestamp with time zone NULL;
""");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
"""
ALTER TABLE IF EXISTS "ClipSubmissions"
DROP COLUMN IF EXISTS "ReviewNote";
ALTER TABLE IF EXISTS "ClipSubmissions"
DROP COLUMN IF EXISTS "ReviewedByTwitchId";
ALTER TABLE IF EXISTS "ClipSubmissions"
DROP COLUMN IF EXISTS "ReviewedAt";
""");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,95 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddNominationReviewWorkflow : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Nominations_SeasonId",
table: "Nominations");
migrationBuilder.AddColumn<string>(
name: "ReviewNote",
table: "Nominations",
type: "character varying(500)",
maxLength: 500,
nullable: true);
migrationBuilder.AddColumn<DateTimeOffset>(
name: "ReviewedAt",
table: "Nominations",
type: "timestamp with time zone",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ReviewedByTwitchId",
table: "Nominations",
type: "character varying(120)",
maxLength: 120,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Status",
table: "Nominations",
type: "character varying(20)",
maxLength: 20,
nullable: false,
defaultValue: "");
migrationBuilder.UpdateData(
table: "Nominations",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "ReviewNote", "ReviewedAt", "ReviewedByTwitchId", "Status" },
values: new object[] { null, null, null, "pending" });
migrationBuilder.UpdateData(
table: "Nominations",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "ReviewNote", "ReviewedAt", "ReviewedByTwitchId", "Status" },
values: new object[] { null, null, null, "pending" });
migrationBuilder.CreateIndex(
name: "IX_Nominations_SeasonId_Status",
table: "Nominations",
columns: new[] { "SeasonId", "Status" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Nominations_SeasonId_Status",
table: "Nominations");
migrationBuilder.DropColumn(
name: "ReviewNote",
table: "Nominations");
migrationBuilder.DropColumn(
name: "ReviewedAt",
table: "Nominations");
migrationBuilder.DropColumn(
name: "ReviewedByTwitchId",
table: "Nominations");
migrationBuilder.DropColumn(
name: "Status",
table: "Nominations");
migrationBuilder.CreateIndex(
name: "IX_Nominations_SeasonId",
table: "Nominations",
column: "SeasonId");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,93 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddAwardResultCategoryLock : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Results_SeasonId",
table: "Results");
migrationBuilder.AddColumn<int>(
name: "CategoryId",
table: "Results",
type: "integer",
nullable: true);
migrationBuilder.Sql(
"""
UPDATE "Results" AS r
SET "CategoryId" = c."Id"
FROM "Categories" AS c
WHERE r."SeasonId" = c."SeasonId"
AND lower(trim(r."CategoryName")) = lower(trim(c."Name"));
DO $$
BEGIN
IF EXISTS (SELECT 1 FROM "Results" WHERE "CategoryId" IS NULL) THEN
RAISE EXCEPTION 'Could not backfill CategoryId for one or more rows in Results.';
END IF;
END $$;
""");
migrationBuilder.AlterColumn<int>(
name: "CategoryId",
table: "Results",
type: "integer",
nullable: false,
oldClrType: typeof(int),
oldType: "integer",
oldNullable: true);
migrationBuilder.CreateIndex(
name: "IX_Results_CategoryId",
table: "Results",
column: "CategoryId");
migrationBuilder.CreateIndex(
name: "IX_Results_SeasonId_CategoryId",
table: "Results",
columns: new[] { "SeasonId", "CategoryId" },
unique: true);
migrationBuilder.AddForeignKey(
name: "FK_Results_Categories_CategoryId",
table: "Results",
column: "CategoryId",
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Results_Categories_CategoryId",
table: "Results");
migrationBuilder.DropIndex(
name: "IX_Results_CategoryId",
table: "Results");
migrationBuilder.DropIndex(
name: "IX_Results_SeasonId_CategoryId",
table: "Results");
migrationBuilder.DropColumn(
name: "CategoryId",
table: "Results");
migrationBuilder.CreateIndex(
name: "IX_Results_SeasonId",
table: "Results",
column: "SeasonId");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,58 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddSeasonShowStreamUrl : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ShowStreamUrl",
table: "Seasons",
type: "character varying(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.UpdateData(
table: "Seasons",
keyColumn: "Id",
keyValue: 1,
column: "ShowStreamUrl",
value: "https://twitch.tv/jayuhime");
migrationBuilder.UpdateData(
table: "Seasons",
keyColumn: "Id",
keyValue: 2,
column: "ShowStreamUrl",
value: "https://twitch.tv/jayuhime");
migrationBuilder.UpdateData(
table: "Seasons",
keyColumn: "Id",
keyValue: 3,
column: "ShowStreamUrl",
value: "https://youtube.com/c/Jayuhime");
migrationBuilder.UpdateData(
table: "Seasons",
keyColumn: "Id",
keyValue: 4,
column: "ShowStreamUrl",
value: "https://twitch.tv/jayuhime");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ShowStreamUrl",
table: "Seasons");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,48 @@
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddSiteSettings : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "SiteSettings",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
HostDisplayName = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
HostTagline = table.Column<string>(type: "character varying(160)", maxLength: 160, nullable: false),
NewsletterUrl = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
PrivacyEmail = table.Column<string>(type: "character varying(160)", maxLength: 160, nullable: false),
ImprintUrl = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
ContactUrl = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
SponsorsUrl = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
SocialLinksJson = table.Column<string>(type: "text", nullable: false),
FaqJson = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SiteSettings", x => x.Id);
});
migrationBuilder.InsertData(
table: "SiteSettings",
columns: new[] { "Id", "ContactUrl", "FaqJson", "HostDisplayName", "HostTagline", "ImprintUrl", "NewsletterUrl", "PrivacyEmail", "SocialLinksJson", "SponsorsUrl" },
values: new object[] { 1, "https://vtuber-star-awards.de/kontakt", "[{\"question\":\"Wer darf mitmachen?\",\"answer\":\"Jede:r mit einem Twitch-Account. Einmal einloggen gen\\u00FCgt \\u2013 kein extra Konto, kein Papierkram.\"},{\"question\":\"Wie werden die Gewinner bestimmt?\",\"answer\":\"Komplett durch eure Stimmen. Die Community entscheidet, wer auf die B\\u00FChne darf.\"},{\"question\":\"Kann ich meine Wahl noch \\u00E4ndern?\",\"answer\":\"Ja. Bis zum Ende der Voting-Phase kannst du Nominierungen und Stimmen anpassen.\"},{\"question\":\"Wann und wo findet die Show statt?\",\"answer\":\"Die gro\\u00DFe Live-Show wird von Jayuhime gehostet und live auf den verkn\\u00FCpften Plattformen \\u00FCbertragen.\"}]", "Jayuhime", "VTuber & Award Host", "https://vtuber-star-awards.de/impressum", "https://vtuber-star-awards.de/newsletter", "datenschutz@vtuber-star-awards.de", "[{\"label\":\"Twitch\",\"platform\":\"twitch\",\"url\":\"https://twitch.tv/jayuhime\"},{\"label\":\"YouTube\",\"platform\":\"youtube\",\"url\":\"https://youtube.com/c/Jayuhime\"},{\"label\":\"X\",\"platform\":\"x\",\"url\":\"https://x.com/jayuhime\"},{\"label\":\"Instagram\",\"platform\":\"instagram\",\"url\":\"https://instagram.com/jayuhime\"},{\"label\":\"Discord\",\"platform\":\"discord\",\"url\":\"https://discord.gg/jayuhime\"}]", "https://vtuber-star-awards.de/partner" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "SiteSettings");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,58 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddPrivacyPolicyContentMetadata : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "PrivacyPolicyContent",
table: "SiteSettings",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<DateTimeOffset>(
name: "PrivacyPolicyUpdatedAt",
table: "SiteSettings",
type: "timestamp with time zone",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "PrivacyPolicyUpdatedBy",
table: "SiteSettings",
type: "character varying(120)",
maxLength: 120,
nullable: true);
migrationBuilder.UpdateData(
table: "SiteSettings",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "PrivacyPolicyContent", "PrivacyPolicyUpdatedAt", "PrivacyPolicyUpdatedBy" },
values: new object[] { "Verantwortliche:r\nVTuber Star Awards, vertreten durch Jayuhime. Kontakt: datenschutz@vtuber-star-awards.de\n\nWelche Daten wir verarbeiten\nBei Teilnahme (Voting, Nominierung, Clip-Einreichung) verarbeiten wir ausschließlich deine Twitch-User-ID sowie den Zeitstempel deiner Aktion.\nFür Show-Erinnerungen speichern wir optional deine E-Mail-Adresse.\n\nRechtsgrundlage\nVerarbeitung auf Basis von Art. 6 Abs. 1 lit. b DSGVO. Für optionale Erinnerungen gilt Art. 6 Abs. 1 lit. a DSGVO.\n\nZweck der Verarbeitung\nDurchführung des VTuber Star Awards, Sicherstellung fairer Abstimmung, Spam-Prävention sowie Admin-Review von Einreichungen.\n\nLöschfristen\nAlle Teilnahmedaten werden spätestens 6 Monate nach der Award-Show automatisch gelöscht. E-Mail-Adressen werden nach der Show entfernt.\n\nDeine Rechte\nDu hast das Recht auf Auskunft, Löschung, Berichtigung, Widerspruch und Beschwerde bei der zuständigen Aufsichtsbehörde.\n\nWeitergabe an Dritte\nKeine Weitergabe zu Werbezwecken. Technische Dienstleister verarbeiten Daten ausschließlich im Rahmen der Auftragsverarbeitung.", new DateTimeOffset(new DateTime(2026, 6, 23, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), "seed" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PrivacyPolicyContent",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "PrivacyPolicyUpdatedAt",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "PrivacyPolicyUpdatedBy",
table: "SiteSettings");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,143 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddOperationalSiteSettings : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "DemoLoginDisplayName",
table: "SiteSettings",
type: "character varying(120)",
maxLength: 120,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "DemoLoginEmail",
table: "SiteSettings",
type: "character varying(180)",
maxLength: 180,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<bool>(
name: "DemoLoginEnabled",
table: "SiteSettings",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "DemoLoginManagedByDatabase",
table: "SiteSettings",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "DemoLoginPasswordHash",
table: "SiteSettings",
type: "character varying(120)",
maxLength: 120,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "DemoLoginPasswordSalt",
table: "SiteSettings",
type: "character varying(80)",
maxLength: 80,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "DemoLoginTwitchUserId",
table: "SiteSettings",
type: "character varying(120)",
maxLength: 120,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "MaintenanceMessage",
table: "SiteSettings",
type: "character varying(600)",
maxLength: 600,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<bool>(
name: "MaintenanceModeEnabled",
table: "SiteSettings",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "MaintenanceTitle",
table: "SiteSettings",
type: "character varying(120)",
maxLength: 120,
nullable: false,
defaultValue: "");
migrationBuilder.UpdateData(
table: "SiteSettings",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "DemoLoginDisplayName", "DemoLoginEmail", "DemoLoginEnabled", "DemoLoginManagedByDatabase", "DemoLoginPasswordHash", "DemoLoginPasswordSalt", "DemoLoginTwitchUserId", "MaintenanceMessage", "MaintenanceModeEnabled", "MaintenanceTitle" },
values: new object[] { "Jayuhime Admin", "", false, false, "", "", "jayuhime_admin", "Die Award-Galaxie wird gerade liebevoll poliert. Schau gleich wieder vorbei.", false, "Sternenpause" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DemoLoginDisplayName",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "DemoLoginEmail",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "DemoLoginEnabled",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "DemoLoginManagedByDatabase",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "DemoLoginPasswordHash",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "DemoLoginPasswordSalt",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "DemoLoginTwitchUserId",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "MaintenanceMessage",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "MaintenanceModeEnabled",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "MaintenanceTitle",
table: "SiteSettings");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,57 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddSeasonShowStartsAt : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
"""
ALTER TABLE "Seasons"
ADD COLUMN IF NOT EXISTS "ShowStartsAt" time without time zone NOT NULL DEFAULT TIME '20:00:00';
""");
migrationBuilder.UpdateData(
table: "Seasons",
keyColumn: "Id",
keyValue: 1,
column: "ShowStartsAt",
value: new TimeOnly(20, 0, 0));
migrationBuilder.UpdateData(
table: "Seasons",
keyColumn: "Id",
keyValue: 2,
column: "ShowStartsAt",
value: new TimeOnly(20, 0, 0));
migrationBuilder.UpdateData(
table: "Seasons",
keyColumn: "Id",
keyValue: 3,
column: "ShowStartsAt",
value: new TimeOnly(20, 0, 0));
migrationBuilder.UpdateData(
table: "Seasons",
keyColumn: "Id",
keyValue: 4,
column: "ShowStartsAt",
value: new TimeOnly(20, 0, 0));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ShowStartsAt",
table: "Seasons");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,54 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddClipCandidateLink : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
"""
ALTER TABLE IF EXISTS "ClipSubmissions"
ADD COLUMN IF NOT EXISTS "CandidateId" integer NULL;
DO $$
BEGIN
IF to_regclass('"ClipSubmissions"') IS NOT NULL THEN
CREATE INDEX IF NOT EXISTS "IX_ClipSubmissions_CandidateId"
ON "ClipSubmissions" ("CandidateId");
IF NOT EXISTS (
SELECT 1
FROM pg_constraint
WHERE conname = 'FK_ClipSubmissions_Candidates_CandidateId'
) THEN
ALTER TABLE "ClipSubmissions"
ADD CONSTRAINT "FK_ClipSubmissions_Candidates_CandidateId"
FOREIGN KEY ("CandidateId") REFERENCES "Candidates" ("Id")
ON DELETE SET NULL;
END IF;
END IF;
END $$;
""");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
"""
ALTER TABLE IF EXISTS "ClipSubmissions"
DROP CONSTRAINT IF EXISTS "FK_ClipSubmissions_Candidates_CandidateId";
DROP INDEX IF EXISTS "IX_ClipSubmissions_CandidateId";
ALTER TABLE IF EXISTS "ClipSubmissions"
DROP COLUMN IF EXISTS "CandidateId";
""");
}
}
}
@@ -0,0 +1,34 @@
using Backend.Data;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
[DbContext(typeof(AwardsDbContext))]
[Migration("20260624150500_AddRiskFlagReviewNote")]
public partial class AddRiskFlagReviewNote : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
"""
ALTER TABLE IF EXISTS "RiskFlags"
ADD COLUMN IF NOT EXISTS "ReviewNote" character varying(500) NULL;
""");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
"""
ALTER TABLE IF EXISTS "RiskFlags"
DROP COLUMN IF EXISTS "ReviewNote";
""");
}
}
}
@@ -0,0 +1,39 @@
using Backend.Data;
using Backend.Services;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
[DbContext(typeof(AwardsDbContext))]
[Migration("20260624162000_AddRiskRulesJson")]
public partial class AddRiskRulesJson : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
$"""
ALTER TABLE IF EXISTS "SiteSettings"
ADD COLUMN IF NOT EXISTS "RiskRulesJson" text NOT NULL DEFAULT '{RiskRuleSettings.Serialize(RiskRuleSettings.Defaults).Replace("'", "''")}';
UPDATE "SiteSettings"
SET "RiskRulesJson" = '{RiskRuleSettings.Serialize(RiskRuleSettings.Defaults).Replace("'", "''")}'
WHERE "RiskRulesJson" IS NULL OR btrim("RiskRulesJson") = '' OR "RiskRulesJson" = '[]';
""");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
"""
ALTER TABLE IF EXISTS "SiteSettings"
DROP COLUMN IF EXISTS "RiskRulesJson";
""");
}
}
}
@@ -0,0 +1,54 @@
using Backend.Data;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
[DbContext(typeof(AwardsDbContext))]
[Migration("20260625110000_AddFooterPageContent")]
public partial class AddFooterPageContent : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
var imprintContent = SeedCatalog.DefaultImprintContent.Replace("'", "''");
var contactContent = SeedCatalog.DefaultContactContent.Replace("'", "''");
var sponsorsContent = SeedCatalog.DefaultSponsorsContent.Replace("'", "''");
migrationBuilder.Sql(
$"""
ALTER TABLE IF EXISTS "SiteSettings"
ADD COLUMN IF NOT EXISTS "ImprintContent" text NOT NULL DEFAULT '',
ADD COLUMN IF NOT EXISTS "ContactContent" text NOT NULL DEFAULT '',
ADD COLUMN IF NOT EXISTS "SponsorsContent" text NOT NULL DEFAULT '';
UPDATE "SiteSettings"
SET "ImprintContent" = '{imprintContent}'
WHERE "ImprintContent" IS NULL OR btrim("ImprintContent") = '';
UPDATE "SiteSettings"
SET "ContactContent" = '{contactContent}'
WHERE "ContactContent" IS NULL OR btrim("ContactContent") = '';
UPDATE "SiteSettings"
SET "SponsorsContent" = '{sponsorsContent}'
WHERE "SponsorsContent" IS NULL OR btrim("SponsorsContent") = '';
""");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
"""
ALTER TABLE IF EXISTS "SiteSettings"
DROP COLUMN IF EXISTS "ImprintContent",
DROP COLUMN IF EXISTS "ContactContent",
DROP COLUMN IF EXISTS "SponsorsContent";
""");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,79 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddTeamManagement : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "TeamMembers",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Login = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
DisplayName = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
Role = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
PasswordHash = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
PasswordSalt = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
MustChangePassword = table.Column<bool>(type: "boolean", nullable: false),
IsActive = table.Column<bool>(type: "boolean", nullable: false),
CreatedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
UpdatedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
UpdatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
LastLoginAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
PasswordResetAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_TeamMembers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "TeamRolePermissions",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Role = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
PermissionsJson = table.Column<string>(type: "text", nullable: false),
UpdatedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
UpdatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TeamRolePermissions", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_TeamMembers_Login",
table: "TeamMembers",
column: "Login",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_TeamRolePermissions_Role",
table: "TeamRolePermissions",
column: "Role",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "TeamMembers");
migrationBuilder.DropTable(
name: "TeamRolePermissions");
}
}
}
@@ -0,0 +1,66 @@
using System;
using Backend.Data;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
[DbContext(typeof(AwardsDbContext))]
[Migration("20260625153000_AddCreatorRoleAndTeamTwitchBinding")]
public partial class AddCreatorRoleAndTeamTwitchBinding : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "BoundTwitchDisplayName",
table: "TeamMembers",
type: "character varying(120)",
maxLength: 120,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "BoundTwitchUserId",
table: "TeamMembers",
type: "character varying(120)",
maxLength: 120,
nullable: true);
migrationBuilder.AddColumn<DateTimeOffset>(
name: "TwitchBoundAt",
table: "TeamMembers",
type: "timestamp with time zone",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_TeamMembers_BoundTwitchUserId",
table: "TeamMembers",
column: "BoundTwitchUserId",
unique: true,
filter: "\"BoundTwitchUserId\" IS NOT NULL");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_TeamMembers_BoundTwitchUserId",
table: "TeamMembers");
migrationBuilder.DropColumn(
name: "BoundTwitchDisplayName",
table: "TeamMembers");
migrationBuilder.DropColumn(
name: "BoundTwitchUserId",
table: "TeamMembers");
migrationBuilder.DropColumn(
name: "TwitchBoundAt",
table: "TeamMembers");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,135 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddVoteBallotSubmitterUniqueIndex : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_VoteBallots_SeasonId",
table: "VoteBallots");
migrationBuilder.AddColumn<bool>(
name: "TwitchAuthManagedByDatabase",
table: "SiteSettings",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "TwitchClientId",
table: "SiteSettings",
type: "character varying(120)",
maxLength: 120,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "TwitchClientSecret",
table: "SiteSettings",
type: "character varying(180)",
maxLength: 180,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "TwitchRedirectUri",
table: "SiteSettings",
type: "character varying(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "TwitchScope",
table: "SiteSettings",
type: "character varying(300)",
maxLength: 300,
nullable: false,
defaultValue: "");
migrationBuilder.UpdateData(
table: "SiteSettings",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "TwitchAuthManagedByDatabase", "TwitchClientId", "TwitchClientSecret", "TwitchRedirectUri", "TwitchScope" },
values: new object[] { false, "", "", "", "" });
migrationBuilder.Sql("""
DELETE FROM "VoteEntries"
WHERE "BallotId" IN (
SELECT "Id"
FROM (
SELECT
"Id",
ROW_NUMBER() OVER (
PARTITION BY "SeasonId", "SubmittedByTwitchId"
ORDER BY "SubmittedAt" DESC, "Id" DESC
) AS duplicate_rank
FROM "VoteBallots"
) ranked_ballots
WHERE duplicate_rank > 1
);
DELETE FROM "VoteBallots"
WHERE "Id" IN (
SELECT "Id"
FROM (
SELECT
"Id",
ROW_NUMBER() OVER (
PARTITION BY "SeasonId", "SubmittedByTwitchId"
ORDER BY "SubmittedAt" DESC, "Id" DESC
) AS duplicate_rank
FROM "VoteBallots"
) ranked_ballots
WHERE duplicate_rank > 1
);
""");
migrationBuilder.CreateIndex(
name: "IX_VoteBallots_SeasonId_SubmittedByTwitchId",
table: "VoteBallots",
columns: new[] { "SeasonId", "SubmittedByTwitchId" },
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_VoteBallots_SeasonId_SubmittedByTwitchId",
table: "VoteBallots");
migrationBuilder.DropColumn(
name: "TwitchAuthManagedByDatabase",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "TwitchClientId",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "TwitchClientSecret",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "TwitchRedirectUri",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "TwitchScope",
table: "SiteSettings");
migrationBuilder.CreateIndex(
name: "IX_VoteBallots_SeasonId",
table: "VoteBallots",
column: "SeasonId");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,177 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddCandidatePreparationFields : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "AcceptanceNote",
table: "Candidates",
type: "character varying(500)",
maxLength: 500,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "AcceptanceStatus",
table: "Candidates",
type: "character varying(30)",
maxLength: 30,
nullable: false,
defaultValue: "open");
migrationBuilder.AddColumn<string>(
name: "ClipCompilationPlatform",
table: "Candidates",
type: "character varying(40)",
maxLength: 40,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ClipCompilationTitle",
table: "Candidates",
type: "character varying(200)",
maxLength: 200,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ClipCompilationUrl",
table: "Candidates",
type: "character varying(500)",
maxLength: 500,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ClipEmbedStatus",
table: "Candidates",
type: "character varying(30)",
maxLength: 30,
nullable: false,
defaultValue: "unchecked");
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "AcceptanceNote", "AcceptanceStatus", "ClipCompilationPlatform", "ClipCompilationTitle", "ClipCompilationUrl", "ClipEmbedStatus" },
values: new object[] { null, "open", null, null, null, "unchecked" });
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "AcceptanceNote", "AcceptanceStatus", "ClipCompilationPlatform", "ClipCompilationTitle", "ClipCompilationUrl", "ClipEmbedStatus" },
values: new object[] { null, "open", null, null, null, "unchecked" });
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 3,
columns: new[] { "AcceptanceNote", "AcceptanceStatus", "ClipCompilationPlatform", "ClipCompilationTitle", "ClipCompilationUrl", "ClipEmbedStatus" },
values: new object[] { null, "open", null, null, null, "unchecked" });
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 4,
columns: new[] { "AcceptanceNote", "AcceptanceStatus", "ClipCompilationPlatform", "ClipCompilationTitle", "ClipCompilationUrl", "ClipEmbedStatus" },
values: new object[] { null, "open", null, null, null, "unchecked" });
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 5,
columns: new[] { "AcceptanceNote", "AcceptanceStatus", "ClipCompilationPlatform", "ClipCompilationTitle", "ClipCompilationUrl", "ClipEmbedStatus" },
values: new object[] { null, "open", null, null, null, "unchecked" });
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 6,
columns: new[] { "AcceptanceNote", "AcceptanceStatus", "ClipCompilationPlatform", "ClipCompilationTitle", "ClipCompilationUrl", "ClipEmbedStatus" },
values: new object[] { null, "open", null, null, null, "unchecked" });
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 7,
columns: new[] { "AcceptanceNote", "AcceptanceStatus", "ClipCompilationPlatform", "ClipCompilationTitle", "ClipCompilationUrl", "ClipEmbedStatus" },
values: new object[] { null, "open", null, null, null, "unchecked" });
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 8,
columns: new[] { "AcceptanceNote", "AcceptanceStatus", "ClipCompilationPlatform", "ClipCompilationTitle", "ClipCompilationUrl", "ClipEmbedStatus" },
values: new object[] { null, "open", null, null, null, "unchecked" });
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 9,
columns: new[] { "AcceptanceNote", "AcceptanceStatus", "ClipCompilationPlatform", "ClipCompilationTitle", "ClipCompilationUrl", "ClipEmbedStatus" },
values: new object[] { null, "open", null, null, null, "unchecked" });
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 10,
columns: new[] { "AcceptanceNote", "AcceptanceStatus", "ClipCompilationPlatform", "ClipCompilationTitle", "ClipCompilationUrl", "ClipEmbedStatus" },
values: new object[] { null, "open", null, null, null, "unchecked" });
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 11,
columns: new[] { "AcceptanceNote", "AcceptanceStatus", "ClipCompilationPlatform", "ClipCompilationTitle", "ClipCompilationUrl", "ClipEmbedStatus" },
values: new object[] { null, "open", null, null, null, "unchecked" });
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 12,
columns: new[] { "AcceptanceNote", "AcceptanceStatus", "ClipCompilationPlatform", "ClipCompilationTitle", "ClipCompilationUrl", "ClipEmbedStatus" },
values: new object[] { null, "open", null, null, null, "unchecked" });
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 13,
columns: new[] { "AcceptanceNote", "AcceptanceStatus", "ClipCompilationPlatform", "ClipCompilationTitle", "ClipCompilationUrl", "ClipEmbedStatus" },
values: new object[] { null, "open", null, null, null, "unchecked" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AcceptanceNote",
table: "Candidates");
migrationBuilder.DropColumn(
name: "AcceptanceStatus",
table: "Candidates");
migrationBuilder.DropColumn(
name: "ClipCompilationPlatform",
table: "Candidates");
migrationBuilder.DropColumn(
name: "ClipCompilationTitle",
table: "Candidates");
migrationBuilder.DropColumn(
name: "ClipCompilationUrl",
table: "Candidates");
migrationBuilder.DropColumn(
name: "ClipEmbedStatus",
table: "Candidates");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,35 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddWorkflowRulesJson : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("""
ALTER TABLE "SiteSettings"
ADD COLUMN IF NOT EXISTS "WorkflowRulesJson" text NOT NULL DEFAULT '[]';
""");
migrationBuilder.UpdateData(
table: "SiteSettings",
keyColumn: "Id",
keyValue: 1,
column: "WorkflowRulesJson",
value: "[{\"key\":\"max_finalists_per_category\",\"label\":\"Finale Kandidat:innen pro Kategorie\",\"enabled\":true,\"limit\":4,\"mode\":\"block\",\"description\":\"Begrenzt, wie viele finale Kandidat:innen in einer Kategorie vorbereitet werden.\"},{\"key\":\"max_candidate_appearances\",\"label\":\"Kandidaturen pro Person\",\"enabled\":true,\"limit\":2,\"mode\":\"warn\",\"description\":\"Warnt oder blockiert, wenn dieselbe Person in zu vielen Kategorien final auftaucht.\"},{\"key\":\"max_winner_placements\",\"label\":\"Gewinnerpl\\u00E4tze pro Person\",\"enabled\":true,\"limit\":1,\"mode\":\"block\",\"description\":\"Verhindert oder warnt, wenn dieselbe Person mehrfach als Gewinner:in gesetzt wird.\"}]");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("""
ALTER TABLE "SiteSettings"
DROP COLUMN IF EXISTS "WorkflowRulesJson";
""");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,55 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddOptionalClipFeatureSettings : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("""
ALTER TABLE "SiteSettings"
ADD COLUMN IF NOT EXISTS "ClipReviewEnabled" boolean NOT NULL DEFAULT true;
""");
migrationBuilder.Sql("""
ALTER TABLE "SiteSettings"
ADD COLUMN IF NOT EXISTS "ClipSubmissionDisabledMessage" character varying(240) NOT NULL DEFAULT 'Clip-Einreichungen sind aktuell geschlossen.';
""");
migrationBuilder.Sql("""
ALTER TABLE "SiteSettings"
ADD COLUMN IF NOT EXISTS "ClipSubmissionsEnabled" boolean NOT NULL DEFAULT false;
""");
migrationBuilder.UpdateData(
table: "SiteSettings",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "ClipReviewEnabled", "ClipSubmissionDisabledMessage" },
values: new object[] { true, "Clip-Einreichungen sind aktuell geschlossen." });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("""
ALTER TABLE "SiteSettings"
DROP COLUMN IF EXISTS "ClipReviewEnabled";
""");
migrationBuilder.Sql("""
ALTER TABLE "SiteSettings"
DROP COLUMN IF EXISTS "ClipSubmissionDisabledMessage";
""");
migrationBuilder.Sql("""
ALTER TABLE "SiteSettings"
DROP COLUMN IF EXISTS "ClipSubmissionsEnabled";
""");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,36 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddNominationLinkBlacklist : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "NominationLinkBlacklistJson",
table: "SiteSettings",
type: "text",
nullable: false,
defaultValue: "[]");
migrationBuilder.UpdateData(
table: "SiteSettings",
keyColumn: "Id",
keyValue: 1,
column: "NominationLinkBlacklistJson",
value: "[{\"Url\":\"https://kick.com/\"},{\"Url\":\"https://www.twitch.tv/\"},{\"Url\":\"https://www.youtube.com/\"}]");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "NominationLinkBlacklistJson",
table: "SiteSettings");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,152 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddClipAdminMenuVisible : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("""
ALTER TABLE "SiteSettings"
ADD COLUMN IF NOT EXISTS "ClipAdminMenuVisible" boolean NOT NULL DEFAULT FALSE;
ALTER TABLE "SiteSettings"
ADD COLUMN IF NOT EXISTS "ShowactApplicationDisabledMessage" character varying(240) NOT NULL DEFAULT '';
ALTER TABLE "SiteSettings"
ADD COLUMN IF NOT EXISTS "ShowactApplicationsEnabled" boolean NOT NULL DEFAULT FALSE;
ALTER TABLE "SiteSettings"
ADD COLUMN IF NOT EXISTS "ShowactsContent" text NOT NULL DEFAULT '';
ALTER TABLE "SiteSettings"
ADD COLUMN IF NOT EXISTS "ShowactsUrl" character varying(400) NOT NULL DEFAULT '';
ALTER TABLE "SiteSettings"
ADD COLUMN IF NOT EXISTS "SponsorsVisible" boolean NOT NULL DEFAULT TRUE;
""");
migrationBuilder.Sql("""
CREATE TABLE IF NOT EXISTS "ShowactApplications" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
"SeasonId" integer NOT NULL,
"ArtistName" character varying(120) NOT NULL,
"ContactEmail" character varying(180) NOT NULL,
"ContactDiscord" character varying(120) NOT NULL,
"PlatformUrl" character varying(500) NOT NULL,
"PerformanceType" character varying(80) NOT NULL,
"Description" character varying(1000) NOT NULL,
"TechnicalNotes" character varying(1000) NOT NULL,
"ReferenceUrl" character varying(500) NOT NULL,
"Status" character varying(20) NOT NULL,
"ReviewNote" character varying(500) NULL,
"ReviewedByTwitchId" character varying(120) NULL,
"CreatedFromIp" character varying(80) NOT NULL,
"UserAgent" character varying(400) NOT NULL,
"CreatedAt" timestamp with time zone NOT NULL,
"ReviewedAt" timestamp with time zone NULL
);
CREATE TABLE IF NOT EXISTS "Sponsors" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
"SeasonId" integer NOT NULL,
"Name" character varying(120) NOT NULL,
"WebsiteUrl" character varying(500) NOT NULL,
"LogoUrl" character varying(500) NOT NULL,
"Description" character varying(500) NOT NULL,
"Tier" character varying(80) NOT NULL,
"SortOrder" integer NOT NULL,
"IsVisible" boolean NOT NULL,
"CreatedAt" timestamp with time zone NOT NULL,
"UpdatedAt" timestamp with time zone NULL
);
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1
FROM pg_constraint
WHERE conname = 'FK_ShowactApplications_Seasons_SeasonId'
) THEN
ALTER TABLE "ShowactApplications"
ADD CONSTRAINT "FK_ShowactApplications_Seasons_SeasonId"
FOREIGN KEY ("SeasonId") REFERENCES "Seasons" ("Id")
ON DELETE CASCADE;
END IF;
END $$;
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1
FROM pg_constraint
WHERE conname = 'FK_Sponsors_Seasons_SeasonId'
) THEN
ALTER TABLE "Sponsors"
ADD CONSTRAINT "FK_Sponsors_Seasons_SeasonId"
FOREIGN KEY ("SeasonId") REFERENCES "Seasons" ("Id")
ON DELETE CASCADE;
END IF;
END $$;
""");
migrationBuilder.UpdateData(
table: "SiteSettings",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "ClipAdminMenuVisible", "ShowactApplicationDisabledMessage", "ShowactsContent", "ShowactsUrl", "SponsorsVisible", "WorkflowRulesJson" },
values: new object[] { true, "Showact-Bewerbungen sind aktuell geschlossen.", "Informationen zu Showact-Bewerbungen, Ablauf und Kontakt fuer die Award-Show.", "https://vtuber-star-awards.de/showacts", true, "[{\"key\":\"max_finalists_per_category\",\"label\":\"Finale Kandidat:innen pro Kategorie\",\"enabled\":true,\"limit\":4,\"mode\":\"block\",\"description\":\"Begrenzt, wie viele finale Kandidat:innen in einer Kategorie vorbereitet werden.\"},{\"key\":\"max_candidate_appearances\",\"label\":\"Kandidaturen pro Person\",\"enabled\":true,\"limit\":2,\"mode\":\"warn\",\"description\":\"Warnt oder blockiert, wenn dieselbe Person in zu vielen Kategorien final auftaucht.\"},{\"key\":\"max_winner_placements\",\"label\":\"Gewinnerpl\\u00E4tze pro Person\",\"enabled\":true,\"limit\":1,\"mode\":\"block\",\"description\":\"Verhindert oder warnt, wenn dieselbe Person mehrfach als Gewinner:in gesetzt wird.\"},{\"key\":\"winner_requires_clip\",\"label\":\"Gewinner braucht Clip-Link\",\"enabled\":true,\"limit\":1,\"mode\":\"block\",\"description\":\"Verhindert oder warnt, wenn ein Gewinner ohne gepflegten YouTube-/Twitch-Clip gesetzt wird.\"}]" });
migrationBuilder.Sql("""
CREATE INDEX IF NOT EXISTS "IX_ShowactApplications_SeasonId_Status"
ON "ShowactApplications" ("SeasonId", "Status");
CREATE INDEX IF NOT EXISTS "IX_Sponsors_SeasonId_IsVisible_SortOrder"
ON "Sponsors" ("SeasonId", "IsVisible", "SortOrder");
""");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("""
DROP TABLE IF EXISTS "ShowactApplications";
DROP TABLE IF EXISTS "Sponsors";
""");
migrationBuilder.Sql("""
ALTER TABLE "SiteSettings"
DROP COLUMN IF EXISTS "ClipAdminMenuVisible";
ALTER TABLE "SiteSettings"
DROP COLUMN IF EXISTS "ShowactApplicationDisabledMessage";
ALTER TABLE "SiteSettings"
DROP COLUMN IF EXISTS "ShowactApplicationsEnabled";
ALTER TABLE "SiteSettings"
DROP COLUMN IF EXISTS "ShowactsContent";
ALTER TABLE "SiteSettings"
DROP COLUMN IF EXISTS "ShowactsUrl";
ALTER TABLE "SiteSettings"
DROP COLUMN IF EXISTS "SponsorsVisible";
""");
migrationBuilder.UpdateData(
table: "SiteSettings",
keyColumn: "Id",
keyValue: 1,
column: "WorkflowRulesJson",
value: "[{\"key\":\"max_finalists_per_category\",\"label\":\"Finale Kandidat:innen pro Kategorie\",\"enabled\":true,\"limit\":4,\"mode\":\"block\",\"description\":\"Begrenzt, wie viele finale Kandidat:innen in einer Kategorie vorbereitet werden.\"},{\"key\":\"max_candidate_appearances\",\"label\":\"Kandidaturen pro Person\",\"enabled\":true,\"limit\":2,\"mode\":\"warn\",\"description\":\"Warnt oder blockiert, wenn dieselbe Person in zu vielen Kategorien final auftaucht.\"},{\"key\":\"max_winner_placements\",\"label\":\"Gewinnerpl\\u00E4tze pro Person\",\"enabled\":true,\"limit\":1,\"mode\":\"block\",\"description\":\"Verhindert oder warnt, wenn dieselbe Person mehrfach als Gewinner:in gesetzt wird.\"}]");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,47 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddShareUrls : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ShareDiscordUrl",
table: "SiteSettings",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "ShareXUrl",
table: "SiteSettings",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.UpdateData(
table: "SiteSettings",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "ShareDiscordUrl", "ShareXUrl" },
values: new object[] { "", "" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ShareDiscordUrl",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "ShareXUrl",
table: "SiteSettings");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,47 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddShowactDynamicForm : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ShowactFormSchemaJson",
table: "SiteSettings",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "FieldResponsesJson",
table: "ShowactApplications",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.UpdateData(
table: "SiteSettings",
keyColumn: "Id",
keyValue: 1,
column: "ShowactFormSchemaJson",
value: "[]");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ShowactFormSchemaJson",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "FieldResponsesJson",
table: "ShowactApplications");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,108 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddCategoryViewerRanges : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "ViewerRangeMax",
table: "Categories",
type: "integer",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "ViewerRangeMin",
table: "Categories",
type: "integer",
nullable: true);
migrationBuilder.UpdateData(
table: "Categories",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "ViewerRangeMax", "ViewerRangeMin" },
values: new object[] { null, null });
migrationBuilder.UpdateData(
table: "Categories",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "ViewerRangeMax", "ViewerRangeMin" },
values: new object[] { null, null });
migrationBuilder.UpdateData(
table: "Categories",
keyColumn: "Id",
keyValue: 3,
columns: new[] { "ViewerRangeMax", "ViewerRangeMin" },
values: new object[] { null, null });
migrationBuilder.UpdateData(
table: "Categories",
keyColumn: "Id",
keyValue: 4,
columns: new[] { "ViewerRangeMax", "ViewerRangeMin" },
values: new object[] { null, null });
migrationBuilder.UpdateData(
table: "Categories",
keyColumn: "Id",
keyValue: 5,
columns: new[] { "ViewerRangeMax", "ViewerRangeMin" },
values: new object[] { null, null });
migrationBuilder.UpdateData(
table: "Categories",
keyColumn: "Id",
keyValue: 6,
columns: new[] { "ViewerRangeMax", "ViewerRangeMin" },
values: new object[] { null, null });
migrationBuilder.UpdateData(
table: "Categories",
keyColumn: "Id",
keyValue: 7,
columns: new[] { "ViewerRangeMax", "ViewerRangeMin" },
values: new object[] { null, null });
migrationBuilder.UpdateData(
table: "Categories",
keyColumn: "Id",
keyValue: 8,
columns: new[] { "ViewerRangeMax", "ViewerRangeMin" },
values: new object[] { null, null });
migrationBuilder.UpdateData(
table: "Categories",
keyColumn: "Id",
keyValue: 9,
columns: new[] { "ViewerRangeMax", "ViewerRangeMin" },
values: new object[] { null, null });
migrationBuilder.UpdateData(
table: "Categories",
keyColumn: "Id",
keyValue: 10,
columns: new[] { "ViewerRangeMax", "ViewerRangeMin" },
values: new object[] { null, null });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ViewerRangeMax",
table: "Categories");
migrationBuilder.DropColumn(
name: "ViewerRangeMin",
table: "Categories");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,36 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddSessionIdleTimeoutSettings : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "SessionIdleTimeoutHours",
table: "SiteSettings",
type: "integer",
nullable: false,
defaultValue: 3);
migrationBuilder.UpdateData(
table: "SiteSettings",
keyColumn: "Id",
keyValue: 1,
column: "SessionIdleTimeoutHours",
value: 3);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "SessionIdleTimeoutHours",
table: "SiteSettings");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,57 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddSeasonSubcategoryTemplates : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "SubcategoryTemplatesJson",
table: "Seasons",
type: "text",
nullable: false,
defaultValue: "[]");
migrationBuilder.UpdateData(
table: "Seasons",
keyColumn: "Id",
keyValue: 1,
column: "SubcategoryTemplatesJson",
value: "[]");
migrationBuilder.UpdateData(
table: "Seasons",
keyColumn: "Id",
keyValue: 2,
column: "SubcategoryTemplatesJson",
value: "[]");
migrationBuilder.UpdateData(
table: "Seasons",
keyColumn: "Id",
keyValue: 3,
column: "SubcategoryTemplatesJson",
value: "[]");
migrationBuilder.UpdateData(
table: "Seasons",
keyColumn: "Id",
keyValue: 4,
column: "SubcategoryTemplatesJson",
value: "[]");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "SubcategoryTemplatesJson",
table: "Seasons");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,388 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddNominationGroupTrackerIdentity : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Nominations_Categories_CategoryId",
table: "Nominations");
migrationBuilder.AlterColumn<int>(
name: "CategoryId",
table: "Nominations",
type: "integer",
nullable: true,
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AddColumn<int>(
name: "AvgViewers",
table: "Nominations",
type: "integer",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CategoryGroupName",
table: "Nominations",
type: "character varying(80)",
maxLength: 80,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "ResolvedChannel",
table: "Nominations",
type: "character varying(120)",
maxLength: 120,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ResolvedPlatform",
table: "Nominations",
type: "character varying(40)",
maxLength: 40,
nullable: true);
migrationBuilder.AddColumn<int>(
name: "StreamerIdentityId",
table: "Nominations",
type: "integer",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "SuggestedCategoryId",
table: "Nominations",
type: "integer",
nullable: true);
migrationBuilder.AddColumn<DateTimeOffset>(
name: "TrackerCheckedAt",
table: "Nominations",
type: "timestamp with time zone",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "TrackerStatus",
table: "Nominations",
type: "character varying(40)",
maxLength: 40,
nullable: false,
defaultValue: "pending");
migrationBuilder.AddColumn<int>(
name: "NominationTally",
table: "Candidates",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "StreamerIdentityId",
table: "Candidates",
type: "integer",
nullable: true);
migrationBuilder.CreateTable(
name: "StreamerIdentities",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Platform = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
Login = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
NormalizedKey = table.Column<string>(type: "character varying(180)", maxLength: 180, nullable: false),
DisplayName = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
ProfileUrl = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true),
LastResolvedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_StreamerIdentities", x => x.Id);
});
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 1,
column: "StreamerIdentityId",
value: null);
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 2,
column: "StreamerIdentityId",
value: null);
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 3,
column: "StreamerIdentityId",
value: null);
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 4,
column: "StreamerIdentityId",
value: null);
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 5,
column: "StreamerIdentityId",
value: null);
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 6,
column: "StreamerIdentityId",
value: null);
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 7,
column: "StreamerIdentityId",
value: null);
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 8,
column: "StreamerIdentityId",
value: null);
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 9,
column: "StreamerIdentityId",
value: null);
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 10,
column: "StreamerIdentityId",
value: null);
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 11,
column: "StreamerIdentityId",
value: null);
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 12,
column: "StreamerIdentityId",
value: null);
migrationBuilder.UpdateData(
table: "Candidates",
keyColumn: "Id",
keyValue: 13,
column: "StreamerIdentityId",
value: null);
migrationBuilder.UpdateData(
table: "Nominations",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "AvgViewers", "CategoryGroupName", "ResolvedChannel", "ResolvedPlatform", "StreamerIdentityId", "SuggestedCategoryId", "TrackerCheckedAt", "TrackerStatus" },
values: new object[] { null, "", null, null, null, null, null, "pending" });
migrationBuilder.UpdateData(
table: "Nominations",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "AvgViewers", "CategoryGroupName", "ResolvedChannel", "ResolvedPlatform", "StreamerIdentityId", "SuggestedCategoryId", "TrackerCheckedAt", "TrackerStatus" },
values: new object[] { null, "", null, null, null, null, null, "pending" });
migrationBuilder.Sql("""
UPDATE "Nominations" n
SET "CategoryGroupName" = c."GroupName"
FROM "Categories" c
WHERE n."CategoryId" = c."Id"
AND COALESCE(n."CategoryGroupName", '') = '';
""");
migrationBuilder.CreateIndex(
name: "IX_Nominations_SeasonId_CategoryGroupName_Status",
table: "Nominations",
columns: new[] { "SeasonId", "CategoryGroupName", "Status" });
migrationBuilder.CreateIndex(
name: "IX_Nominations_SeasonId_StreamerIdentityId_CategoryGroupName",
table: "Nominations",
columns: new[] { "SeasonId", "StreamerIdentityId", "CategoryGroupName" });
migrationBuilder.CreateIndex(
name: "IX_Nominations_StreamerIdentityId",
table: "Nominations",
column: "StreamerIdentityId");
migrationBuilder.CreateIndex(
name: "IX_Nominations_SuggestedCategoryId",
table: "Nominations",
column: "SuggestedCategoryId");
migrationBuilder.CreateIndex(
name: "IX_Candidates_StreamerIdentityId",
table: "Candidates",
column: "StreamerIdentityId");
migrationBuilder.CreateIndex(
name: "IX_StreamerIdentities_NormalizedKey",
table: "StreamerIdentities",
column: "NormalizedKey",
unique: true);
migrationBuilder.AddForeignKey(
name: "FK_Candidates_StreamerIdentities_StreamerIdentityId",
table: "Candidates",
column: "StreamerIdentityId",
principalTable: "StreamerIdentities",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Nominations_Categories_CategoryId",
table: "Nominations",
column: "CategoryId",
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey(
name: "FK_Nominations_Categories_SuggestedCategoryId",
table: "Nominations",
column: "SuggestedCategoryId",
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
migrationBuilder.AddForeignKey(
name: "FK_Nominations_StreamerIdentities_StreamerIdentityId",
table: "Nominations",
column: "StreamerIdentityId",
principalTable: "StreamerIdentities",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Candidates_StreamerIdentities_StreamerIdentityId",
table: "Candidates");
migrationBuilder.DropForeignKey(
name: "FK_Nominations_Categories_CategoryId",
table: "Nominations");
migrationBuilder.DropForeignKey(
name: "FK_Nominations_Categories_SuggestedCategoryId",
table: "Nominations");
migrationBuilder.DropForeignKey(
name: "FK_Nominations_StreamerIdentities_StreamerIdentityId",
table: "Nominations");
migrationBuilder.DropTable(
name: "StreamerIdentities");
migrationBuilder.DropIndex(
name: "IX_Nominations_SeasonId_CategoryGroupName_Status",
table: "Nominations");
migrationBuilder.DropIndex(
name: "IX_Nominations_SeasonId_StreamerIdentityId_CategoryGroupName",
table: "Nominations");
migrationBuilder.DropIndex(
name: "IX_Nominations_StreamerIdentityId",
table: "Nominations");
migrationBuilder.DropIndex(
name: "IX_Nominations_SuggestedCategoryId",
table: "Nominations");
migrationBuilder.DropIndex(
name: "IX_Candidates_StreamerIdentityId",
table: "Candidates");
migrationBuilder.DropColumn(
name: "AvgViewers",
table: "Nominations");
migrationBuilder.DropColumn(
name: "CategoryGroupName",
table: "Nominations");
migrationBuilder.DropColumn(
name: "ResolvedChannel",
table: "Nominations");
migrationBuilder.DropColumn(
name: "ResolvedPlatform",
table: "Nominations");
migrationBuilder.DropColumn(
name: "StreamerIdentityId",
table: "Nominations");
migrationBuilder.DropColumn(
name: "SuggestedCategoryId",
table: "Nominations");
migrationBuilder.DropColumn(
name: "TrackerCheckedAt",
table: "Nominations");
migrationBuilder.DropColumn(
name: "TrackerStatus",
table: "Nominations");
migrationBuilder.DropColumn(
name: "NominationTally",
table: "Candidates");
migrationBuilder.DropColumn(
name: "StreamerIdentityId",
table: "Candidates");
migrationBuilder.AlterColumn<int>(
name: "CategoryId",
table: "Nominations",
type: "integer",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "integer",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_Nominations_Categories_CategoryId",
table: "Nominations",
column: "CategoryId",
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}
@@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Backend.Migrations namespace Backend.Migrations
{ {
[DbContext(typeof(AwardsDbContext))] [DbContext(typeof(AwardsDbContext))]
[Migration("20260629142009_InitialCleanBaseline")] [Migration("20260628161949_AddShowactApplicationSchedule")]
partial class InitialCleanBaseline partial class AddShowactApplicationSchedule
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -112,6 +112,56 @@ namespace Backend.Migrations
.IsUnique(); .IsUnique();
b.ToTable("Results"); b.ToTable("Results");
b.HasData(
new
{
Id = 1,
CandidateId = 8,
CategoryId = 5,
CategoryName = "VTuber des Jahres",
SeasonId = 2
},
new
{
Id = 2,
CandidateId = 9,
CategoryId = 6,
CategoryName = "Bestes Live Event",
SeasonId = 2
},
new
{
Id = 3,
CandidateId = 10,
CategoryId = 7,
CategoryName = "Clip des Jahres",
SeasonId = 2
},
new
{
Id = 4,
CandidateId = 11,
CategoryId = 8,
CategoryName = "VTuber des Jahres",
SeasonId = 3
},
new
{
Id = 5,
CandidateId = 12,
CategoryId = 9,
CategoryName = "Clip des Jahres",
SeasonId = 3
},
new
{
Id = 6,
CandidateId = 13,
CategoryId = 10,
CategoryName = "VTuber des Jahres",
SeasonId = 4
});
}); });
modelBuilder.Entity("Backend.Domain.Candidate", b => modelBuilder.Entity("Backend.Domain.Candidate", b =>
@@ -190,6 +240,164 @@ namespace Backend.Migrations
b.HasIndex("StreamerIdentityId"); b.HasIndex("StreamerIdentityId");
b.ToTable("Candidates"); b.ToTable("Candidates");
b.HasData(
new
{
Id = 1,
AcceptanceStatus = "open",
CategoryId = 1,
ChannelSlug = "@hoshimimiyu",
ClipEmbedStatus = "unchecked",
DisplayName = "Hoshimi Miyu",
NominationTally = 0,
Platform = "Twitch",
SeasonId = 1
},
new
{
Id = 2,
AcceptanceStatus = "open",
CategoryId = 1,
ChannelSlug = "@kurainu",
ClipEmbedStatus = "unchecked",
DisplayName = "Kurainu",
NominationTally = 0,
Platform = "Twitch",
SeasonId = 1
},
new
{
Id = 3,
AcceptanceStatus = "open",
CategoryId = 1,
ChannelSlug = "@shiroch",
ClipEmbedStatus = "unchecked",
DisplayName = "Shiro Ch.",
NominationTally = 0,
Platform = "Twitch",
SeasonId = 1
},
new
{
Id = 4,
AcceptanceStatus = "open",
CategoryId = 2,
ChannelSlug = "@kurainu",
ClipEmbedStatus = "unchecked",
DisplayName = "Kurainu 3D Live",
NominationTally = 0,
Platform = "Twitch",
SeasonId = 1
},
new
{
Id = 5,
AcceptanceStatus = "open",
CategoryId = 2,
ChannelSlug = "@aoisakura",
ClipEmbedStatus = "unchecked",
DisplayName = "Aoi Sakura Showcase",
NominationTally = 0,
Platform = "YouTube",
SeasonId = 1
},
new
{
Id = 6,
AcceptanceStatus = "open",
CategoryId = 3,
ChannelSlug = "@pyonkichikingdom",
ClipEmbedStatus = "unchecked",
DisplayName = "Pyonkichi Kingdom",
NominationTally = 0,
Platform = "Twitch",
SeasonId = 1
},
new
{
Id = 7,
AcceptanceStatus = "open",
CategoryId = 4,
ChannelSlug = "@moonrelay",
ClipEmbedStatus = "unchecked",
DisplayName = "Moonrelay",
NominationTally = 0,
Platform = "Twitch",
SeasonId = 1
},
new
{
Id = 8,
AcceptanceStatus = "open",
CategoryId = 5,
ChannelSlug = "@hoshimimiyu",
ClipEmbedStatus = "unchecked",
DisplayName = "Hoshimi Miyu",
NominationTally = 0,
Platform = "Twitch",
SeasonId = 2
},
new
{
Id = 9,
AcceptanceStatus = "open",
CategoryId = 6,
ChannelSlug = "@kurainu",
ClipEmbedStatus = "unchecked",
DisplayName = "Kurainu 3D Live",
NominationTally = 0,
Platform = "Twitch",
SeasonId = 2
},
new
{
Id = 10,
AcceptanceStatus = "open",
CategoryId = 7,
ChannelSlug = "@pyonkichikingdom",
ClipEmbedStatus = "unchecked",
DisplayName = "Pyonkichi Kingdom",
NominationTally = 0,
Platform = "Twitch",
SeasonId = 2
},
new
{
Id = 11,
AcceptanceStatus = "open",
CategoryId = 8,
ChannelSlug = "@aoisakura",
ClipEmbedStatus = "unchecked",
DisplayName = "Aoi Sakura",
NominationTally = 0,
Platform = "YouTube",
SeasonId = 3
},
new
{
Id = 12,
AcceptanceStatus = "open",
CategoryId = 9,
ChannelSlug = "@starbyte",
ClipEmbedStatus = "unchecked",
DisplayName = "Starbyte",
NominationTally = 0,
Platform = "Twitch",
SeasonId = 3
},
new
{
Id = 13,
AcceptanceStatus = "open",
CategoryId = 10,
ChannelSlug = "@tenshivox",
ClipEmbedStatus = "unchecked",
DisplayName = "Tenshi Vox",
NominationTally = 0,
Platform = "Twitch",
SeasonId = 4
});
}); });
modelBuilder.Entity("Backend.Domain.Category", b => modelBuilder.Entity("Backend.Domain.Category", b =>
@@ -240,6 +448,118 @@ namespace Backend.Migrations
.IsUnique(); .IsUnique();
b.ToTable("Categories"); b.ToTable("Categories");
b.HasData(
new
{
Id = 1,
Description = "Die groesste Auszeichnung des Jahres.",
GroupName = "Main Awards",
MaxNomineesPerUser = 3,
Name = "VTuber des Jahres",
SeasonId = 1,
Slug = "vtuber-des-jahres",
SortOrder = 1
},
new
{
Id = 2,
Description = "Events, Konzerte und 3D-Shows.",
GroupName = "Performance",
MaxNomineesPerUser = 3,
Name = "Bestes Live Event",
SeasonId = 1,
Slug = "bestes-live-event",
SortOrder = 2
},
new
{
Id = 3,
Description = "Der lustigste oder emotionalste Clip des Jahres.",
GroupName = "Clips & Highlights",
MaxNomineesPerUser = 3,
Name = "Clip des Jahres",
SeasonId = 1,
Slug = "clip-des-jahres",
SortOrder = 3
},
new
{
Id = 4,
Description = "Die aktivste und freundlichste Community.",
GroupName = "Main Awards",
MaxNomineesPerUser = 3,
Name = "Beste Community",
SeasonId = 1,
Slug = "beste-community",
SortOrder = 4
},
new
{
Id = 5,
Description = "Archivkategorie 2025.",
GroupName = "Main Awards",
MaxNomineesPerUser = 3,
Name = "VTuber des Jahres",
SeasonId = 2,
Slug = "vtuber-des-jahres",
SortOrder = 1
},
new
{
Id = 6,
Description = "Archivkategorie 2025.",
GroupName = "Performance",
MaxNomineesPerUser = 3,
Name = "Bestes Live Event",
SeasonId = 2,
Slug = "bestes-live-event",
SortOrder = 2
},
new
{
Id = 7,
Description = "Archivkategorie 2025.",
GroupName = "Clips & Highlights",
MaxNomineesPerUser = 3,
Name = "Clip des Jahres",
SeasonId = 2,
Slug = "clip-des-jahres",
SortOrder = 3
},
new
{
Id = 8,
Description = "Archivkategorie 2024.",
GroupName = "Main Awards",
MaxNomineesPerUser = 3,
Name = "VTuber des Jahres",
SeasonId = 3,
Slug = "vtuber-des-jahres",
SortOrder = 1
},
new
{
Id = 9,
Description = "Archivkategorie 2024.",
GroupName = "Clips & Highlights",
MaxNomineesPerUser = 3,
Name = "Clip des Jahres",
SeasonId = 3,
Slug = "clip-des-jahres",
SortOrder = 2
},
new
{
Id = 10,
Description = "Archivkategorie 2023.",
GroupName = "Main Awards",
MaxNomineesPerUser = 3,
Name = "VTuber des Jahres",
SeasonId = 4,
Slug = "vtuber-des-jahres",
SortOrder = 1
});
}); });
modelBuilder.Entity("Backend.Domain.ClipSubmission", b => modelBuilder.Entity("Backend.Domain.ClipSubmission", b =>
@@ -348,18 +668,6 @@ namespace Backend.Migrations
b.Property<DateTimeOffset>("CreatedAt") b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone"); .HasColumnType("timestamp with time zone");
b.Property<int?>("FollowersGained")
.HasColumnType("integer");
b.Property<int?>("HoursStreamed")
.HasColumnType("integer");
b.Property<int?>("HoursWatched")
.HasColumnType("integer");
b.Property<int?>("PeakViewers")
.HasColumnType("integer");
b.Property<string>("ResolvedChannel") b.Property<string>("ResolvedChannel")
.HasMaxLength(120) .HasMaxLength(120)
.HasColumnType("character varying(120)"); .HasColumnType("character varying(120)");
@@ -412,30 +720,6 @@ namespace Backend.Migrations
.HasColumnType("character varying(40)") .HasColumnType("character varying(40)")
.HasDefaultValue("pending"); .HasDefaultValue("pending");
b.Property<string>("TrackingFlagsJson")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("text")
.HasDefaultValue("[]");
b.Property<string>("TrackingReviewNote")
.HasMaxLength(1000)
.HasColumnType("character varying(1000)");
b.Property<string>("TrackingReviewStatus")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(30)
.HasColumnType("character varying(30)")
.HasDefaultValue("clear");
b.Property<DateTimeOffset?>("TrackingReviewedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("TrackingReviewedByTwitchId")
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("CandidateId"); b.HasIndex("CandidateId");
@@ -453,6 +737,32 @@ namespace Backend.Migrations
b.HasIndex("SeasonId", "StreamerIdentityId", "CategoryGroupName"); b.HasIndex("SeasonId", "StreamerIdentityId", "CategoryGroupName");
b.ToTable("Nominations"); b.ToTable("Nominations");
b.HasData(
new
{
Id = 1,
CandidateText = "Hoshimi Miyu",
CategoryGroupName = "",
CategoryId = 1,
CreatedAt = new DateTimeOffset(new DateTime(2026, 6, 10, 13, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
SeasonId = 1,
Status = "pending",
SubmittedByTwitchId = "twitch_hoshi",
TrackerStatus = "pending"
},
new
{
Id = 2,
CandidateText = "Kurainu 3D Live",
CategoryGroupName = "",
CategoryId = 2,
CreatedAt = new DateTimeOffset(new DateTime(2026, 6, 10, 14, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
SeasonId = 1,
Status = "pending",
SubmittedByTwitchId = "twitch_kurainu",
TrackerStatus = "pending"
});
}); });
modelBuilder.Entity("Backend.Domain.RiskFlag", b => modelBuilder.Entity("Backend.Domain.RiskFlag", b =>
@@ -549,11 +859,6 @@ namespace Backend.Migrations
b.Property<bool>("IsCurrent") b.Property<bool>("IsCurrent")
.HasColumnType("boolean"); .HasColumnType("boolean");
b.Property<bool>("IsDemo")
.ValueGeneratedOnAdd()
.HasColumnType("boolean")
.HasDefaultValue(false);
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasMaxLength(160) .HasMaxLength(160)
@@ -577,6 +882,11 @@ namespace Backend.Migrations
b.Property<TimeOnly>("ShowStartsAt") b.Property<TimeOnly>("ShowStartsAt")
.HasColumnType("time without time zone"); .HasColumnType("time without time zone");
b.Property<string>("ShowStreamUrl")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("character varying(400)");
b.Property<string>("SubcategoryTemplatesJson") b.Property<string>("SubcategoryTemplatesJson")
.IsRequired() .IsRequired()
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@@ -589,19 +899,6 @@ namespace Backend.Migrations
b.Property<DateOnly>("VotingStartsAt") b.Property<DateOnly>("VotingStartsAt")
.HasColumnType("date"); .HasColumnType("date");
b.Property<DateTimeOffset?>("WinnersPublishedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("WinnersPublishedByTwitchId")
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.Property<string>("WorkflowRulesJson")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("text")
.HasDefaultValue("[]");
b.Property<int>("Year") b.Property<int>("Year")
.HasColumnType("integer"); .HasColumnType("integer");
@@ -611,6 +908,84 @@ namespace Backend.Migrations
.IsUnique(); .IsUnique();
b.ToTable("Seasons"); b.ToTable("Seasons");
b.HasData(
new
{
Id = 1,
CurrentPhase = "Community Voting",
IsCommunityOnly = true,
IsCurrent = true,
Name = "VTuber Star Awards 2026",
NominationEndsAt = new DateOnly(2026, 5, 31),
NominationStartsAt = new DateOnly(2026, 5, 1),
ReviewEndsAt = new DateOnly(2026, 7, 10),
ReviewStartsAt = new DateOnly(2026, 7, 1),
ShowDate = new DateOnly(2026, 7, 20),
ShowStartsAt = new TimeOnly(20, 0, 0),
ShowStreamUrl = "https://twitch.tv/jayuhime",
SubcategoryTemplatesJson = "[]",
VotingEndsAt = new DateOnly(2026, 6, 30),
VotingStartsAt = new DateOnly(2026, 6, 1),
Year = 2026
},
new
{
Id = 2,
CurrentPhase = "Archived",
IsCommunityOnly = true,
IsCurrent = false,
Name = "VTuber Star Awards 2025",
NominationEndsAt = new DateOnly(2025, 5, 31),
NominationStartsAt = new DateOnly(2025, 5, 1),
ReviewEndsAt = new DateOnly(2025, 7, 10),
ReviewStartsAt = new DateOnly(2025, 7, 1),
ShowDate = new DateOnly(2025, 7, 20),
ShowStartsAt = new TimeOnly(20, 0, 0),
ShowStreamUrl = "https://twitch.tv/jayuhime",
SubcategoryTemplatesJson = "[]",
VotingEndsAt = new DateOnly(2025, 6, 30),
VotingStartsAt = new DateOnly(2025, 6, 1),
Year = 2025
},
new
{
Id = 3,
CurrentPhase = "Archived",
IsCommunityOnly = true,
IsCurrent = false,
Name = "VTuber Star Awards 2024",
NominationEndsAt = new DateOnly(2024, 5, 31),
NominationStartsAt = new DateOnly(2024, 5, 1),
ReviewEndsAt = new DateOnly(2024, 7, 10),
ReviewStartsAt = new DateOnly(2024, 7, 1),
ShowDate = new DateOnly(2024, 7, 20),
ShowStartsAt = new TimeOnly(20, 0, 0),
ShowStreamUrl = "https://youtube.com/c/Jayuhime",
SubcategoryTemplatesJson = "[]",
VotingEndsAt = new DateOnly(2024, 6, 30),
VotingStartsAt = new DateOnly(2024, 6, 1),
Year = 2024
},
new
{
Id = 4,
CurrentPhase = "Archived",
IsCommunityOnly = true,
IsCurrent = false,
Name = "VTuber Star Awards 2023",
NominationEndsAt = new DateOnly(2023, 5, 31),
NominationStartsAt = new DateOnly(2023, 5, 1),
ReviewEndsAt = new DateOnly(2023, 7, 10),
ReviewStartsAt = new DateOnly(2023, 7, 1),
ShowDate = new DateOnly(2023, 7, 20),
ShowStartsAt = new TimeOnly(20, 0, 0),
ShowStreamUrl = "https://twitch.tv/jayuhime",
SubcategoryTemplatesJson = "[]",
VotingEndsAt = new DateOnly(2023, 6, 30),
VotingStartsAt = new DateOnly(2023, 6, 1),
Year = 2023
});
}); });
modelBuilder.Entity("Backend.Domain.ShowactApplication", b => modelBuilder.Entity("Backend.Domain.ShowactApplication", b =>
@@ -712,14 +1087,6 @@ namespace Backend.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("AwardsSectionDescription")
.IsRequired()
.HasColumnType("text");
b.Property<string>("AwardsSectionTitle")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("ClipAdminMenuVisible") b.Property<bool>("ClipAdminMenuVisible")
.HasColumnType("boolean"); .HasColumnType("boolean");
@@ -907,80 +1274,6 @@ namespace Backend.Migrations
.HasColumnType("boolean") .HasColumnType("boolean")
.HasDefaultValue(true); .HasDefaultValue(true);
b.Property<string>("StreamBannerCompletedButtonLabel")
.IsRequired()
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.Property<string>("StreamBannerCompletedButtonUrl")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("character varying(400)");
b.Property<string>("StreamBannerCompletedEyebrow")
.IsRequired()
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.Property<string>("StreamBannerCompletedText")
.IsRequired()
.HasColumnType("text");
b.Property<string>("StreamBannerCompletedTitle")
.IsRequired()
.HasMaxLength(160)
.HasColumnType("character varying(160)");
b.Property<string>("StreamBannerEyebrow")
.IsRequired()
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.Property<string>("StreamBannerLiveButtonLabel")
.IsRequired()
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.Property<string>("StreamBannerLiveButtonUrl")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("character varying(400)");
b.Property<string>("StreamBannerLockedButtonLabel")
.IsRequired()
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.Property<string>("StreamBannerText")
.IsRequired()
.HasColumnType("text");
b.Property<string>("StreamBannerTitle")
.IsRequired()
.HasMaxLength(160)
.HasColumnType("character varying(160)");
b.Property<bool>("StreamBannerUseCompletedContent")
.HasColumnType("boolean");
b.Property<string>("SubcategoriesSectionDescription")
.IsRequired()
.HasColumnType("text");
b.Property<string>("SubcategoriesSectionTitle")
.IsRequired()
.HasColumnType("text");
b.Property<string>("TrackingReviewNotes")
.IsRequired()
.HasColumnType("text");
b.Property<string>("TrackingRulesJson")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("text")
.HasDefaultValue("[]");
b.Property<bool>("TwitchAuthManagedByDatabase") b.Property<bool>("TwitchAuthManagedByDatabase")
.HasColumnType("boolean"); .HasColumnType("boolean");
@@ -1004,11 +1297,6 @@ namespace Backend.Migrations
.HasMaxLength(300) .HasMaxLength(300)
.HasColumnType("character varying(300)"); .HasColumnType("character varying(300)");
b.Property<string>("ViewerStatsProviderBaseUrl")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("character varying(400)");
b.Property<string>("WorkflowRulesJson") b.Property<string>("WorkflowRulesJson")
.IsRequired() .IsRequired()
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@@ -1018,6 +1306,58 @@ namespace Backend.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.ToTable("SiteSettings"); b.ToTable("SiteSettings");
b.HasData(
new
{
Id = 1,
ClipAdminMenuVisible = true,
ClipReviewEnabled = true,
ClipSubmissionDisabledMessage = "Clip-Einreichungen sind aktuell geschlossen.",
ClipSubmissionsEnabled = false,
ContactContent = "Kontakt zum Award-Team\nDu hast Fragen zur Nominierung, zum Voting, zu Clips oder zur Show? Schreib dem Team ueber die hinterlegte Kontaktseite.\n\nDatenschutzfragen\nFuer Datenschutzanfragen nutze bitte die Datenschutz-E-Mail aus diesem Footer.\n\nCommunity & Kooperationen\nSocial Links und Partneranfragen werden vom Admin-Team gepflegt und koordiniert.",
ContactUrl = "https://vtuber-star-awards.de/kontakt",
DemoLoginDisplayName = "Jayuhime Admin",
DemoLoginEmail = "",
DemoLoginEnabled = false,
DemoLoginManagedByDatabase = false,
DemoLoginPasswordHash = "",
DemoLoginPasswordSalt = "",
DemoLoginTwitchUserId = "jayuhime_admin",
FaqJson = "[{\"question\":\"Wer darf nominiert werden?\",\"answer\":\"Jede:r aktive deutschsprachige VTuber kann nominiert werden \\u2014 unabh\\u00E4ngig von Follower-Zahl oder Plattform. Die Community schl\\u00E4gt in der Nominierungsphase ihre Favorit:innen vor.\"},{\"question\":\"Wie funktioniert das Voting?\",\"answer\":\"Du meldest dich ausschlie\\u00DFlich mit deinem Twitch-Account an \\u2014 nur so kannst du teilnehmen. Das h\\u00E4lt das Voting fair und bot-frei. Danach vergibst du pro Kategorie eine Stimme, \\u00E4nderbar bis zum Ende der Phase.\"},{\"question\":\"Was kostet die Teilnahme?\",\"answer\":\"Gar nichts. Nominieren, voten und die Show schauen ist komplett kostenlos \\u2014 der VTuber Star Award ist ein Community-Event von Fans f\\u00FCr Fans.\"},{\"question\":\"Wann und wo findet die Award-Show statt?\",\"answer\":\"Die gro\\u00DFe Live-Show wird von Jayuhime gehostet und auf Twitch \\u0026 YouTube gestreamt. Den genauen Termin findest du im Countdown oben \\u2014 sei live dabei, wenn die Stars gek\\u00FCrt werden!\"},{\"question\":\"Ich wurde nominiert \\u2014 was nun?\",\"answer\":\"Gl\\u00FCckwunsch! Du erh\\u00E4ltst eine Benachrichtigung mit allen Infos. Teile deine Nominierung gern mit deiner Community und ruf zum Voten auf \\u2014 jede Stimme z\\u00E4hlt.\"}]",
HostDisplayName = "Jayuhime",
HostTagline = "VTuber & Award Host",
ImprintContent = "Anbieter\nVTuber Star Awards, vertreten durch Jayuhime.\n\nKontakt\nNutze fuer organisatorische Fragen bitte die Kontaktseite oder die hinterlegte Kontaktadresse.\n\nHinweis\nDieses Impressum ist ein redaktioneller Platzhalter und sollte vor dem Livegang mit den tatsaechlichen Anbieterangaben ersetzt werden.",
ImprintUrl = "https://vtuber-star-awards.de/impressum",
MaintenanceMessage = "Die Award-Galaxie wird gerade liebevoll poliert. Schau gleich wieder vorbei.",
MaintenanceModeEnabled = false,
MaintenanceTitle = "Sternenpause",
NewsletterUrl = "https://vtuber-star-awards.de/newsletter",
NominationLinkBlacklistJson = "[{\"Url\":\"https://kick.com/\"},{\"Url\":\"https://www.twitch.tv/\"},{\"Url\":\"https://www.youtube.com/\"}]",
PrivacyEmail = "datenschutz@vtuber-star-awards.de",
PrivacyPolicyContent = "Verantwortliche:r\nVTuber Star Awards, vertreten durch Jayuhime. Kontakt: datenschutz@vtuber-star-awards.de\n\nWelche Daten wir verarbeiten\nBei Teilnahme (Voting, Nominierung, Clip-Einreichung) verarbeiten wir ausschließlich deine Twitch-User-ID sowie den Zeitstempel deiner Aktion.\nFür Show-Erinnerungen speichern wir optional deine E-Mail-Adresse.\n\nRechtsgrundlage\nVerarbeitung auf Basis von Art. 6 Abs. 1 lit. b DSGVO. Für optionale Erinnerungen gilt Art. 6 Abs. 1 lit. a DSGVO.\n\nZweck der Verarbeitung\nDurchführung des VTuber Star Awards, Sicherstellung fairer Abstimmung, Spam-Prävention sowie Admin-Review von Einreichungen.\n\nLöschfristen\nAlle Teilnahmedaten werden spätestens 6 Monate nach der Award-Show automatisch gelöscht. E-Mail-Adressen werden nach der Show entfernt.\n\nDeine Rechte\nDu hast das Recht auf Auskunft, Löschung, Berichtigung, Widerspruch und Beschwerde bei der zuständigen Aufsichtsbehörde.\n\nWeitergabe an Dritte\nKeine Weitergabe zu Werbezwecken. Technische Dienstleister verarbeiten Daten ausschließlich im Rahmen der Auftragsverarbeitung.",
PrivacyPolicyUpdatedAt = new DateTimeOffset(new DateTime(2026, 6, 23, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
PrivacyPolicyUpdatedBy = "seed",
RiskRulesJson = "[{\"key\":\"resubmitted_ballot\",\"label\":\"Ballot erneut gespeichert\",\"enabled\":true,\"threshold\":1,\"windowMinutes\":360,\"severity\":\"low\",\"description\":\"Erstellt einen Hinweis, wenn ein User sein Voting erneut speichert.\"},{\"key\":\"rapid_vote_updates\",\"label\":\"Voting-Burst\",\"enabled\":true,\"threshold\":3,\"windowMinutes\":10,\"severity\":\"high\",\"description\":\"Erstellt einen Hinweis, wenn ein User sehr schnell mehrere Voting-Aenderungen ausloest.\"},{\"key\":\"resubmitted_nomination\",\"label\":\"Nominierung erneut eingereicht\",\"enabled\":true,\"threshold\":1,\"windowMinutes\":360,\"severity\":\"low\",\"description\":\"Erstellt einen Hinweis, wenn ein User in derselben Kategorie erneut nominiert.\"},{\"key\":\"rapid_nomination_burst\",\"label\":\"Nominierungs-Burst\",\"enabled\":true,\"threshold\":10,\"windowMinutes\":10,\"severity\":\"high\",\"description\":\"Erstellt einen Hinweis, wenn ein User sehr viele Nominierungen in kurzer Zeit sendet.\"},{\"key\":\"duplicate_clip_submission\",\"label\":\"Doppelter Clip\",\"enabled\":true,\"threshold\":1,\"windowMinutes\":360,\"severity\":\"medium\",\"description\":\"Erstellt einen Hinweis, wenn ein User denselben Clip erneut einreicht.\"},{\"key\":\"rapid_clip_burst\",\"label\":\"Clip-Burst\",\"enabled\":true,\"threshold\":5,\"windowMinutes\":10,\"severity\":\"high\",\"description\":\"Erstellt einen Hinweis, wenn ein User sehr viele Clips in kurzer Zeit sendet.\"},{\"key\":\"rapid_login_ip\",\"label\":\"Login-Burst pro IP\",\"enabled\":true,\"threshold\":3,\"windowMinutes\":15,\"severity\":\"medium\",\"description\":\"Erstellt einen Hinweis, wenn mehrere neue Sessions von derselben IP entstehen.\"},{\"key\":\"rapid_demo_login_ip\",\"label\":\"Demo-Login-Burst pro IP\",\"enabled\":true,\"threshold\":3,\"windowMinutes\":15,\"severity\":\"medium\",\"description\":\"Erstellt einen Hinweis, wenn mehrere Demo-Admin-Sessions von derselben IP entstehen.\"}]",
SessionIdleTimeoutHours = 3,
ShareDiscordUrl = "",
ShareXUrl = "",
ShowactApplicationDisabledMessage = "Showact-Bewerbungen sind aktuell geschlossen.",
ShowactApplicationsEnabled = false,
ShowactFormSchemaJson = "[]",
ShowactsContent = "Informationen zu Showact-Bewerbungen, Ablauf und Kontakt fuer die Award-Show.",
ShowactsUrl = "https://vtuber-star-awards.de/showacts",
SocialLinksJson = "[{\"label\":\"Twitch\",\"platform\":\"twitch\",\"url\":\"https://twitch.tv/jayuhime\",\"icon\":\"twitch\",\"showOnHost\":true,\"showOnCommunity\":true},{\"label\":\"YouTube\",\"platform\":\"youtube\",\"url\":\"https://youtube.com/c/Jayuhime\",\"icon\":\"youtube\",\"showOnHost\":true,\"showOnCommunity\":true},{\"label\":\"X\",\"platform\":\"x\",\"url\":\"https://x.com/jayuhime\",\"icon\":\"x\",\"showOnHost\":true,\"showOnCommunity\":true},{\"label\":\"Instagram\",\"platform\":\"instagram\",\"url\":\"https://instagram.com/jayuhime\",\"icon\":\"instagram\",\"showOnHost\":true,\"showOnCommunity\":true},{\"label\":\"Discord\",\"platform\":\"discord\",\"url\":\"https://discord.gg/jayuhime\",\"icon\":\"discord\",\"showOnHost\":true,\"showOnCommunity\":true}]",
SponsorsContent = "Sponsoren & Partner\nHier koennen Sponsor:innen, Medienpartner, Community-Partner und Supporter des VTuber Star Awards vorgestellt werden.\n\nPartner werden im Rahmen der Show und auf den oeffentlichen Kontaktflaechen genannt, sobald sie final bestaetigt sind.",
SponsorsUrl = "https://vtuber-star-awards.de/partner",
SponsorsVisible = true,
TwitchAuthManagedByDatabase = false,
TwitchClientId = "",
TwitchClientSecret = "",
TwitchRedirectUri = "",
TwitchScope = "",
WorkflowRulesJson = "[{\"key\":\"max_finalists_per_category\",\"label\":\"Finale Kandidat:innen pro Kategorie\",\"enabled\":true,\"limit\":4,\"mode\":\"block\",\"description\":\"Begrenzt, wie viele finale Kandidat:innen in einer Kategorie vorbereitet werden.\"},{\"key\":\"max_candidate_appearances\",\"label\":\"Kandidaturen pro Person\",\"enabled\":true,\"limit\":2,\"mode\":\"warn\",\"description\":\"Warnt oder blockiert, wenn dieselbe Person in zu vielen Kategorien final auftaucht.\"},{\"key\":\"max_winner_placements\",\"label\":\"Gewinnerpl\\u00E4tze pro Person\",\"enabled\":true,\"limit\":1,\"mode\":\"block\",\"description\":\"Verhindert oder warnt, wenn dieselbe Person mehrfach als Gewinner:in gesetzt wird.\"},{\"key\":\"winner_requires_clip\",\"label\":\"Gewinner braucht Clip-Link\",\"enabled\":true,\"limit\":1,\"mode\":\"block\",\"description\":\"Verhindert oder warnt, wenn ein Gewinner ohne gepflegten YouTube-/Twitch-Clip gesetzt wird.\"}]"
});
}); });
modelBuilder.Entity("Backend.Domain.Sponsor", b => modelBuilder.Entity("Backend.Domain.Sponsor", b =>
@@ -1316,6 +1656,24 @@ namespace Backend.Migrations
.IsUnique(); .IsUnique();
b.ToTable("VoteBallots"); b.ToTable("VoteBallots");
b.HasData(
new
{
Id = 1,
SeasonId = 1,
Status = "submitted",
SubmittedAt = new DateTimeOffset(new DateTime(2026, 6, 11, 12, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
SubmittedByTwitchId = "twitch_vote_1"
},
new
{
Id = 2,
SeasonId = 1,
Status = "submitted",
SubmittedAt = new DateTimeOffset(new DateTime(2026, 6, 11, 12, 5, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
SubmittedByTwitchId = "twitch_vote_2"
});
}); });
modelBuilder.Entity("Backend.Domain.VoteEntry", b => modelBuilder.Entity("Backend.Domain.VoteEntry", b =>
@@ -1344,6 +1702,36 @@ namespace Backend.Migrations
b.HasIndex("CategoryId"); b.HasIndex("CategoryId");
b.ToTable("VoteEntries"); b.ToTable("VoteEntries");
b.HasData(
new
{
Id = 1,
BallotId = 1,
CandidateId = 1,
CategoryId = 1
},
new
{
Id = 2,
BallotId = 1,
CandidateId = 4,
CategoryId = 2
},
new
{
Id = 3,
BallotId = 2,
CandidateId = 2,
CategoryId = 1
},
new
{
Id = 4,
BallotId = 2,
CandidateId = 6,
CategoryId = 3
});
}); });
modelBuilder.Entity("Backend.Domain.AwardResult", b => modelBuilder.Entity("Backend.Domain.AwardResult", b =>
@@ -1416,12 +1804,6 @@ namespace Backend.Migrations
.HasForeignKey("CandidateId") .HasForeignKey("CandidateId")
.OnDelete(DeleteBehavior.SetNull); .OnDelete(DeleteBehavior.SetNull);
b.HasOne("Backend.Domain.Season", null)
.WithMany()
.HasForeignKey("SeasonId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Candidate"); b.Navigation("Candidate");
}); });
@@ -0,0 +1,46 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddShowactApplicationSchedule : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateOnly>(
name: "ShowactApplicationEndsAt",
table: "SiteSettings",
type: "date",
nullable: true);
migrationBuilder.AddColumn<DateOnly>(
name: "ShowactApplicationStartsAt",
table: "SiteSettings",
type: "date",
nullable: true);
migrationBuilder.UpdateData(
table: "SiteSettings",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "ShowactApplicationEndsAt", "ShowactApplicationStartsAt" },
values: new object[] { null, null });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ShowactApplicationEndsAt",
table: "SiteSettings");
migrationBuilder.DropColumn(
name: "ShowactApplicationStartsAt",
table: "SiteSettings");
}
}
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,36 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class AddSeasonWorkflowRulesJson : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "WorkflowRulesJson",
table: "Seasons",
type: "text",
nullable: false,
defaultValue: "[]");
migrationBuilder.Sql(
"""
UPDATE "Seasons"
SET "WorkflowRulesJson" = COALESCE(NULLIF((SELECT "WorkflowRulesJson" FROM "SiteSettings" WHERE "Id" = 1), ''), '[]')
WHERE COALESCE("WorkflowRulesJson", '') = '';
""");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "WorkflowRulesJson",
table: "Seasons");
}
}
}
@@ -1,795 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Backend.Migrations
{
/// <inheritdoc />
public partial class InitialCleanBaseline : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AdminAuditEntries",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
AdminTwitchUserId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
ActionType = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
EntityType = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
EntityId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
Summary = table.Column<string>(type: "character varying(240)", maxLength: 240, nullable: false),
MetadataJson = table.Column<string>(type: "text", nullable: false),
CreatedFromIp = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
UserAgent = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AdminAuditEntries", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Seasons",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Year = table.Column<int>(type: "integer", nullable: false),
Name = table.Column<string>(type: "character varying(160)", maxLength: 160, nullable: false),
IsDemo = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
IsCurrent = table.Column<bool>(type: "boolean", nullable: false),
IsCommunityOnly = table.Column<bool>(type: "boolean", nullable: false),
CurrentPhase = table.Column<string>(type: "character varying(60)", maxLength: 60, nullable: false),
NominationStartsAt = table.Column<DateOnly>(type: "date", nullable: false),
NominationEndsAt = table.Column<DateOnly>(type: "date", nullable: false),
VotingStartsAt = table.Column<DateOnly>(type: "date", nullable: false),
VotingEndsAt = table.Column<DateOnly>(type: "date", nullable: false),
ReviewStartsAt = table.Column<DateOnly>(type: "date", nullable: false),
ReviewEndsAt = table.Column<DateOnly>(type: "date", nullable: false),
ShowDate = table.Column<DateOnly>(type: "date", nullable: false),
ShowStartsAt = table.Column<TimeOnly>(type: "time without time zone", nullable: false),
WinnersPublishedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
WinnersPublishedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
SubcategoryTemplatesJson = table.Column<string>(type: "text", nullable: false, defaultValue: "[]"),
WorkflowRulesJson = table.Column<string>(type: "text", nullable: false, defaultValue: "[]")
},
constraints: table =>
{
table.PrimaryKey("PK_Seasons", x => x.Id);
});
migrationBuilder.CreateTable(
name: "SiteSettings",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
HostDisplayName = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
HostTagline = table.Column<string>(type: "character varying(160)", maxLength: 160, nullable: false),
NewsletterUrl = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
ShareXUrl = table.Column<string>(type: "text", nullable: false),
ShareDiscordUrl = table.Column<string>(type: "text", nullable: false),
PrivacyEmail = table.Column<string>(type: "character varying(160)", maxLength: 160, nullable: false),
PrivacyPolicyContent = table.Column<string>(type: "text", nullable: false),
PrivacyPolicyUpdatedBy = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
PrivacyPolicyUpdatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
ImprintUrl = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
ImprintContent = table.Column<string>(type: "text", nullable: false),
ContactUrl = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
ContactContent = table.Column<string>(type: "text", nullable: false),
SponsorsUrl = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
SponsorsContent = table.Column<string>(type: "text", nullable: false),
ShowactsUrl = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
ShowactsContent = table.Column<string>(type: "text", nullable: false, defaultValue: ""),
StreamBannerEyebrow = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
StreamBannerTitle = table.Column<string>(type: "character varying(160)", maxLength: 160, nullable: false),
StreamBannerText = table.Column<string>(type: "text", nullable: false),
StreamBannerLiveButtonLabel = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
StreamBannerLiveButtonUrl = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
StreamBannerLockedButtonLabel = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
StreamBannerUseCompletedContent = table.Column<bool>(type: "boolean", nullable: false),
StreamBannerCompletedEyebrow = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
StreamBannerCompletedTitle = table.Column<string>(type: "character varying(160)", maxLength: 160, nullable: false),
StreamBannerCompletedText = table.Column<string>(type: "text", nullable: false),
StreamBannerCompletedButtonLabel = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
StreamBannerCompletedButtonUrl = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
AwardsSectionTitle = table.Column<string>(type: "text", nullable: false),
AwardsSectionDescription = table.Column<string>(type: "text", nullable: false),
SubcategoriesSectionTitle = table.Column<string>(type: "text", nullable: false),
SubcategoriesSectionDescription = table.Column<string>(type: "text", nullable: false),
SocialLinksJson = table.Column<string>(type: "text", nullable: false),
FaqJson = table.Column<string>(type: "text", nullable: false),
RiskRulesJson = table.Column<string>(type: "text", nullable: false),
WorkflowRulesJson = table.Column<string>(type: "text", nullable: false, defaultValue: "[]"),
TrackingRulesJson = table.Column<string>(type: "text", nullable: false, defaultValue: "[]"),
ViewerStatsProviderBaseUrl = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
TrackingReviewNotes = table.Column<string>(type: "text", nullable: false),
NominationLinkBlacklistJson = table.Column<string>(type: "text", nullable: false, defaultValue: "[]"),
ClipSubmissionsEnabled = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
ClipReviewEnabled = table.Column<bool>(type: "boolean", nullable: false, defaultValue: true),
ClipAdminMenuVisible = table.Column<bool>(type: "boolean", nullable: false),
ClipSubmissionDisabledMessage = table.Column<string>(type: "character varying(240)", maxLength: 240, nullable: false),
ShowactApplicationsEnabled = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
ShowactApplicationStartsAt = table.Column<DateOnly>(type: "date", nullable: true),
ShowactApplicationEndsAt = table.Column<DateOnly>(type: "date", nullable: true),
ShowactApplicationDisabledMessage = table.Column<string>(type: "character varying(240)", maxLength: 240, nullable: false),
ShowactFormSchemaJson = table.Column<string>(type: "text", nullable: false),
SponsorsVisible = table.Column<bool>(type: "boolean", nullable: false, defaultValue: true),
DemoLoginManagedByDatabase = table.Column<bool>(type: "boolean", nullable: false),
DemoLoginEnabled = table.Column<bool>(type: "boolean", nullable: false),
DemoLoginEmail = table.Column<string>(type: "character varying(180)", maxLength: 180, nullable: false),
DemoLoginPasswordHash = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
DemoLoginPasswordSalt = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
DemoLoginTwitchUserId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
DemoLoginDisplayName = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
TwitchAuthManagedByDatabase = table.Column<bool>(type: "boolean", nullable: false),
TwitchClientId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
TwitchClientSecret = table.Column<string>(type: "character varying(180)", maxLength: 180, nullable: false),
TwitchRedirectUri = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
TwitchScope = table.Column<string>(type: "character varying(300)", maxLength: 300, nullable: false),
SessionIdleTimeoutHours = table.Column<int>(type: "integer", nullable: false, defaultValue: 3),
MaintenanceModeEnabled = table.Column<bool>(type: "boolean", nullable: false),
MaintenanceTitle = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
MaintenanceMessage = table.Column<string>(type: "character varying(600)", maxLength: 600, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SiteSettings", x => x.Id);
});
migrationBuilder.CreateTable(
name: "StreamerIdentities",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Platform = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
Login = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
NormalizedKey = table.Column<string>(type: "character varying(180)", maxLength: 180, nullable: false),
DisplayName = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
ProfileUrl = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true),
LastResolvedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_StreamerIdentities", x => x.Id);
});
migrationBuilder.CreateTable(
name: "TeamMembers",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Login = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
DisplayName = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
Role = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
PasswordHash = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
PasswordSalt = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
BoundTwitchUserId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
BoundTwitchDisplayName = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
MustChangePassword = table.Column<bool>(type: "boolean", nullable: false),
IsActive = table.Column<bool>(type: "boolean", nullable: false),
CreatedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
UpdatedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
UpdatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
LastLoginAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
TwitchBoundAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
PasswordResetAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_TeamMembers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "TeamRolePermissions",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Role = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
PermissionsJson = table.Column<string>(type: "text", nullable: false),
UpdatedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
UpdatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TeamRolePermissions", x => x.Id);
});
migrationBuilder.CreateTable(
name: "UserSessions",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
SessionToken = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
TwitchUserId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
DisplayName = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
Role = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
CreatedFromIp = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
UserAgent = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
LastSeenAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
IsActive = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_UserSessions", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Categories",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SeasonId = table.Column<int>(type: "integer", nullable: false),
GroupName = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
Name = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
Slug = table.Column<string>(type: "text", nullable: false),
Description = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
SortOrder = table.Column<int>(type: "integer", nullable: false),
MaxNomineesPerUser = table.Column<int>(type: "integer", nullable: false),
ViewerRangeMin = table.Column<int>(type: "integer", nullable: true),
ViewerRangeMax = table.Column<int>(type: "integer", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Categories", x => x.Id);
table.ForeignKey(
name: "FK_Categories_Seasons_SeasonId",
column: x => x.SeasonId,
principalTable: "Seasons",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "RiskFlags",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SeasonId = table.Column<int>(type: "integer", nullable: true),
TwitchUserId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
Source = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
Type = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
Severity = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
Status = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
Summary = table.Column<string>(type: "character varying(240)", maxLength: 240, nullable: false),
CreatedFromIp = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
UserAgent = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
MetadataJson = table.Column<string>(type: "text", nullable: false),
ReviewNote = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true),
ReviewedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
ReviewedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RiskFlags", x => x.Id);
table.ForeignKey(
name: "FK_RiskFlags_Seasons_SeasonId",
column: x => x.SeasonId,
principalTable: "Seasons",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "ShowactApplications",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SeasonId = table.Column<int>(type: "integer", nullable: false),
ArtistName = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
ContactEmail = table.Column<string>(type: "character varying(180)", maxLength: 180, nullable: false),
ContactDiscord = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
PlatformUrl = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: false),
PerformanceType = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
Description = table.Column<string>(type: "character varying(1000)", maxLength: 1000, nullable: false),
TechnicalNotes = table.Column<string>(type: "character varying(1000)", maxLength: 1000, nullable: false),
ReferenceUrl = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: false),
FieldResponsesJson = table.Column<string>(type: "text", nullable: false),
Status = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
ReviewNote = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true),
ReviewedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
CreatedFromIp = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
UserAgent = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
ReviewedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ShowactApplications", x => x.Id);
table.ForeignKey(
name: "FK_ShowactApplications_Seasons_SeasonId",
column: x => x.SeasonId,
principalTable: "Seasons",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Sponsors",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SeasonId = table.Column<int>(type: "integer", nullable: false),
Name = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
WebsiteUrl = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: false),
LogoUrl = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: false),
Description = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: false),
Tier = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
SortOrder = table.Column<int>(type: "integer", nullable: false),
IsVisible = table.Column<bool>(type: "boolean", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
UpdatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Sponsors", x => x.Id);
table.ForeignKey(
name: "FK_Sponsors_Seasons_SeasonId",
column: x => x.SeasonId,
principalTable: "Seasons",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "VoteBallots",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SeasonId = table.Column<int>(type: "integer", nullable: false),
SubmittedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
Status = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
SubmittedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_VoteBallots", x => x.Id);
table.ForeignKey(
name: "FK_VoteBallots_Seasons_SeasonId",
column: x => x.SeasonId,
principalTable: "Seasons",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Candidates",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SeasonId = table.Column<int>(type: "integer", nullable: false),
CategoryId = table.Column<int>(type: "integer", nullable: false),
StreamerIdentityId = table.Column<int>(type: "integer", nullable: true),
DisplayName = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
ChannelSlug = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
Platform = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
NominationTally = table.Column<int>(type: "integer", nullable: false, defaultValue: 0),
AcceptanceStatus = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false, defaultValue: "open"),
AcceptanceNote = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true),
ClipCompilationUrl = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true),
ClipCompilationTitle = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: true),
ClipCompilationPlatform = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: true),
ClipEmbedStatus = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false, defaultValue: "unchecked")
},
constraints: table =>
{
table.PrimaryKey("PK_Candidates", x => x.Id);
table.ForeignKey(
name: "FK_Candidates_Categories_CategoryId",
column: x => x.CategoryId,
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Candidates_Seasons_SeasonId",
column: x => x.SeasonId,
principalTable: "Seasons",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Candidates_StreamerIdentities_StreamerIdentityId",
column: x => x.StreamerIdentityId,
principalTable: "StreamerIdentities",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "ClipSubmissions",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SeasonId = table.Column<int>(type: "integer", nullable: false),
CategoryId = table.Column<int>(type: "integer", nullable: true),
CandidateId = table.Column<int>(type: "integer", nullable: true),
SubmittedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
ClipUrl = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: false),
Title = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
Creator = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
Platform = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
Status = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
ReviewNote = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true),
ReviewedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
CreatedFromIp = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
ReviewedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ClipSubmissions", x => x.Id);
table.ForeignKey(
name: "FK_ClipSubmissions_Candidates_CandidateId",
column: x => x.CandidateId,
principalTable: "Candidates",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_ClipSubmissions_Seasons_SeasonId",
column: x => x.SeasonId,
principalTable: "Seasons",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Nominations",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SeasonId = table.Column<int>(type: "integer", nullable: false),
CategoryId = table.Column<int>(type: "integer", nullable: true),
CategoryGroupName = table.Column<string>(type: "character varying(80)", maxLength: 80, nullable: false, defaultValue: ""),
SubmittedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false),
CandidateId = table.Column<int>(type: "integer", nullable: true),
StreamerIdentityId = table.Column<int>(type: "integer", nullable: true),
SuggestedCategoryId = table.Column<int>(type: "integer", nullable: true),
CandidateText = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
StreamUrl = table.Column<string>(type: "character varying(300)", maxLength: 300, nullable: true),
ResolvedChannel = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
ResolvedPlatform = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: true),
AvgViewers = table.Column<int>(type: "integer", nullable: true),
HoursStreamed = table.Column<int>(type: "integer", nullable: true),
HoursWatched = table.Column<int>(type: "integer", nullable: true),
PeakViewers = table.Column<int>(type: "integer", nullable: true),
FollowersGained = table.Column<int>(type: "integer", nullable: true),
TrackerStatus = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false, defaultValue: "pending"),
TrackerCheckedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
TrackingReviewStatus = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false, defaultValue: "clear"),
TrackingFlagsJson = table.Column<string>(type: "text", nullable: false, defaultValue: "[]"),
TrackingReviewNote = table.Column<string>(type: "character varying(1000)", maxLength: 1000, nullable: true),
TrackingReviewedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
TrackingReviewedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
Status = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
ReviewNote = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true),
ReviewedByTwitchId = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: true),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
ReviewedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Nominations", x => x.Id);
table.ForeignKey(
name: "FK_Nominations_Candidates_CandidateId",
column: x => x.CandidateId,
principalTable: "Candidates",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Nominations_Categories_CategoryId",
column: x => x.CategoryId,
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Nominations_Categories_SuggestedCategoryId",
column: x => x.SuggestedCategoryId,
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Nominations_Seasons_SeasonId",
column: x => x.SeasonId,
principalTable: "Seasons",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Nominations_StreamerIdentities_StreamerIdentityId",
column: x => x.StreamerIdentityId,
principalTable: "StreamerIdentities",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "Results",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SeasonId = table.Column<int>(type: "integer", nullable: false),
CategoryId = table.Column<int>(type: "integer", nullable: false),
CandidateId = table.Column<int>(type: "integer", nullable: false),
CategoryName = table.Column<string>(type: "character varying(120)", maxLength: 120, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Results", x => x.Id);
table.ForeignKey(
name: "FK_Results_Candidates_CandidateId",
column: x => x.CandidateId,
principalTable: "Candidates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Results_Categories_CategoryId",
column: x => x.CategoryId,
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Results_Seasons_SeasonId",
column: x => x.SeasonId,
principalTable: "Seasons",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "VoteEntries",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
BallotId = table.Column<int>(type: "integer", nullable: false),
CategoryId = table.Column<int>(type: "integer", nullable: false),
CandidateId = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_VoteEntries", x => x.Id);
table.ForeignKey(
name: "FK_VoteEntries_Candidates_CandidateId",
column: x => x.CandidateId,
principalTable: "Candidates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_VoteEntries_Categories_CategoryId",
column: x => x.CategoryId,
principalTable: "Categories",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_VoteEntries_VoteBallots_BallotId",
column: x => x.BallotId,
principalTable: "VoteBallots",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Candidates_CategoryId",
table: "Candidates",
column: "CategoryId");
migrationBuilder.CreateIndex(
name: "IX_Candidates_SeasonId",
table: "Candidates",
column: "SeasonId");
migrationBuilder.CreateIndex(
name: "IX_Candidates_StreamerIdentityId",
table: "Candidates",
column: "StreamerIdentityId");
migrationBuilder.CreateIndex(
name: "IX_Categories_SeasonId_Slug",
table: "Categories",
columns: new[] { "SeasonId", "Slug" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_ClipSubmissions_CandidateId",
table: "ClipSubmissions",
column: "CandidateId");
migrationBuilder.CreateIndex(
name: "IX_ClipSubmissions_SeasonId_Status",
table: "ClipSubmissions",
columns: new[] { "SeasonId", "Status" });
migrationBuilder.CreateIndex(
name: "IX_Nominations_CandidateId",
table: "Nominations",
column: "CandidateId");
migrationBuilder.CreateIndex(
name: "IX_Nominations_CategoryId",
table: "Nominations",
column: "CategoryId");
migrationBuilder.CreateIndex(
name: "IX_Nominations_SeasonId_CategoryGroupName_Status",
table: "Nominations",
columns: new[] { "SeasonId", "CategoryGroupName", "Status" });
migrationBuilder.CreateIndex(
name: "IX_Nominations_SeasonId_Status",
table: "Nominations",
columns: new[] { "SeasonId", "Status" });
migrationBuilder.CreateIndex(
name: "IX_Nominations_SeasonId_StreamerIdentityId_CategoryGroupName",
table: "Nominations",
columns: new[] { "SeasonId", "StreamerIdentityId", "CategoryGroupName" });
migrationBuilder.CreateIndex(
name: "IX_Nominations_StreamerIdentityId",
table: "Nominations",
column: "StreamerIdentityId");
migrationBuilder.CreateIndex(
name: "IX_Nominations_SuggestedCategoryId",
table: "Nominations",
column: "SuggestedCategoryId");
migrationBuilder.CreateIndex(
name: "IX_Results_CandidateId",
table: "Results",
column: "CandidateId");
migrationBuilder.CreateIndex(
name: "IX_Results_CategoryId",
table: "Results",
column: "CategoryId");
migrationBuilder.CreateIndex(
name: "IX_Results_SeasonId_CategoryId",
table: "Results",
columns: new[] { "SeasonId", "CategoryId" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_RiskFlags_SeasonId",
table: "RiskFlags",
column: "SeasonId");
migrationBuilder.CreateIndex(
name: "IX_Seasons_Year",
table: "Seasons",
column: "Year",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_ShowactApplications_SeasonId_Status",
table: "ShowactApplications",
columns: new[] { "SeasonId", "Status" });
migrationBuilder.CreateIndex(
name: "IX_Sponsors_SeasonId_IsVisible_SortOrder",
table: "Sponsors",
columns: new[] { "SeasonId", "IsVisible", "SortOrder" });
migrationBuilder.CreateIndex(
name: "IX_StreamerIdentities_NormalizedKey",
table: "StreamerIdentities",
column: "NormalizedKey",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_TeamMembers_BoundTwitchUserId",
table: "TeamMembers",
column: "BoundTwitchUserId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_TeamMembers_Login",
table: "TeamMembers",
column: "Login",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_TeamRolePermissions_Role",
table: "TeamRolePermissions",
column: "Role",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_UserSessions_SessionToken",
table: "UserSessions",
column: "SessionToken",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_VoteBallots_SeasonId_SubmittedByTwitchId",
table: "VoteBallots",
columns: new[] { "SeasonId", "SubmittedByTwitchId" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_VoteEntries_BallotId",
table: "VoteEntries",
column: "BallotId");
migrationBuilder.CreateIndex(
name: "IX_VoteEntries_CandidateId",
table: "VoteEntries",
column: "CandidateId");
migrationBuilder.CreateIndex(
name: "IX_VoteEntries_CategoryId",
table: "VoteEntries",
column: "CategoryId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AdminAuditEntries");
migrationBuilder.DropTable(
name: "ClipSubmissions");
migrationBuilder.DropTable(
name: "Nominations");
migrationBuilder.DropTable(
name: "Results");
migrationBuilder.DropTable(
name: "RiskFlags");
migrationBuilder.DropTable(
name: "ShowactApplications");
migrationBuilder.DropTable(
name: "SiteSettings");
migrationBuilder.DropTable(
name: "Sponsors");
migrationBuilder.DropTable(
name: "TeamMembers");
migrationBuilder.DropTable(
name: "TeamRolePermissions");
migrationBuilder.DropTable(
name: "UserSessions");
migrationBuilder.DropTable(
name: "VoteEntries");
migrationBuilder.DropTable(
name: "Candidates");
migrationBuilder.DropTable(
name: "VoteBallots");
migrationBuilder.DropTable(
name: "Categories");
migrationBuilder.DropTable(
name: "StreamerIdentities");
migrationBuilder.DropTable(
name: "Seasons");
}
}
}
+159
View File
@@ -0,0 +1,159 @@
CREATE TABLE "__EFMigrationsHistory" (
"MigrationId" character varying(150) NOT NULL,
"ProductVersion" character varying(32) NOT NULL,
CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
);
CREATE TABLE "Seasons" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
"Year" integer NOT NULL,
"Name" character varying(160) NOT NULL,
"IsCurrent" boolean NOT NULL,
"IsCommunityOnly" boolean NOT NULL,
"CurrentPhase" character varying(60) NOT NULL,
"NominationStartsAt" date NOT NULL,
"NominationEndsAt" date NOT NULL,
"VotingStartsAt" date NOT NULL,
"VotingEndsAt" date NOT NULL,
"ReviewStartsAt" date NOT NULL,
"ReviewEndsAt" date NOT NULL,
"ShowDate" date NOT NULL
);
CREATE UNIQUE INDEX "IX_Seasons_Year" ON "Seasons" ("Year");
CREATE TABLE "Categories" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
"SeasonId" integer NOT NULL REFERENCES "Seasons" ("Id") ON DELETE CASCADE,
"GroupName" character varying(80) NOT NULL,
"Name" character varying(120) NOT NULL,
"Slug" text NOT NULL,
"Description" character varying(400) NOT NULL,
"SortOrder" integer NOT NULL,
"MaxNomineesPerUser" integer NOT NULL
);
CREATE UNIQUE INDEX "IX_Categories_SeasonId_Slug" ON "Categories" ("SeasonId", "Slug");
CREATE TABLE "VoteBallots" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
"SeasonId" integer NOT NULL REFERENCES "Seasons" ("Id") ON DELETE CASCADE,
"SubmittedByTwitchId" character varying(120) NOT NULL,
"Status" character varying(30) NOT NULL,
"SubmittedAt" timestamp with time zone NOT NULL
);
CREATE INDEX "IX_VoteBallots_SeasonId" ON "VoteBallots" ("SeasonId");
CREATE TABLE "Candidates" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
"SeasonId" integer NOT NULL REFERENCES "Seasons" ("Id") ON DELETE CASCADE,
"CategoryId" integer NOT NULL REFERENCES "Categories" ("Id") ON DELETE CASCADE,
"DisplayName" character varying(120) NOT NULL,
"ChannelSlug" character varying(120) NOT NULL,
"Platform" character varying(40) NOT NULL
);
CREATE INDEX "IX_Candidates_CategoryId" ON "Candidates" ("CategoryId");
CREATE INDEX "IX_Candidates_SeasonId" ON "Candidates" ("SeasonId");
CREATE TABLE "Nominations" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
"SeasonId" integer NOT NULL REFERENCES "Seasons" ("Id") ON DELETE CASCADE,
"CategoryId" integer NOT NULL REFERENCES "Categories" ("Id") ON DELETE CASCADE,
"SubmittedByTwitchId" character varying(120) NOT NULL,
"CandidateId" integer NULL REFERENCES "Candidates" ("Id"),
"CandidateText" character varying(120) NULL,
"CreatedAt" timestamp with time zone NOT NULL
);
CREATE INDEX "IX_Nominations_CandidateId" ON "Nominations" ("CandidateId");
CREATE INDEX "IX_Nominations_CategoryId" ON "Nominations" ("CategoryId");
CREATE INDEX "IX_Nominations_SeasonId" ON "Nominations" ("SeasonId");
CREATE TABLE "Results" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
"SeasonId" integer NOT NULL REFERENCES "Seasons" ("Id") ON DELETE CASCADE,
"CandidateId" integer NOT NULL REFERENCES "Candidates" ("Id") ON DELETE CASCADE,
"CategoryName" character varying(120) NOT NULL
);
CREATE INDEX "IX_Results_CandidateId" ON "Results" ("CandidateId");
CREATE INDEX "IX_Results_SeasonId" ON "Results" ("SeasonId");
CREATE TABLE "VoteEntries" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
"BallotId" integer NOT NULL REFERENCES "VoteBallots" ("Id") ON DELETE CASCADE,
"CategoryId" integer NOT NULL REFERENCES "Categories" ("Id") ON DELETE CASCADE,
"CandidateId" integer NOT NULL REFERENCES "Candidates" ("Id") ON DELETE CASCADE
);
CREATE INDEX "IX_VoteEntries_BallotId" ON "VoteEntries" ("BallotId");
CREATE INDEX "IX_VoteEntries_CandidateId" ON "VoteEntries" ("CandidateId");
CREATE INDEX "IX_VoteEntries_CategoryId" ON "VoteEntries" ("CategoryId");
INSERT INTO "Seasons" ("Id", "CurrentPhase", "IsCommunityOnly", "IsCurrent", "Name", "NominationEndsAt", "NominationStartsAt", "ReviewEndsAt", "ReviewStartsAt", "ShowDate", "VotingEndsAt", "VotingStartsAt", "Year") VALUES
(1, 'Community Voting', true, true, 'VTuber Star Awards 2026', '2026-05-31', '2026-05-01', '2026-07-10', '2026-07-01', '2026-07-20', '2026-06-30', '2026-06-01', 2026),
(2, 'Archived', true, false, 'VTuber Star Awards 2025', '2025-05-31', '2025-05-01', '2025-07-10', '2025-07-01', '2025-07-20', '2025-06-30', '2025-06-01', 2025),
(3, 'Archived', true, false, 'VTuber Star Awards 2024', '2024-05-31', '2024-05-01', '2024-07-10', '2024-07-01', '2024-07-20', '2024-06-30', '2024-06-01', 2024),
(4, 'Archived', true, false, 'VTuber Star Awards 2023', '2023-05-31', '2023-05-01', '2023-07-10', '2023-07-01', '2023-07-20', '2023-06-30', '2023-06-01', 2023);
INSERT INTO "Categories" ("Id", "Description", "GroupName", "MaxNomineesPerUser", "Name", "SeasonId", "Slug", "SortOrder") VALUES
(1, 'Die groesste Auszeichnung des Jahres.', 'Main Awards', 3, 'VTuber des Jahres', 1, 'vtuber-des-jahres', 1),
(2, 'Events, Konzerte und 3D-Shows.', 'Performance', 3, 'Bestes Live Event', 1, 'bestes-live-event', 2),
(3, 'Der lustigste oder emotionalste Clip des Jahres.', 'Clips & Highlights', 3, 'Clip des Jahres', 1, 'clip-des-jahres', 3),
(4, 'Die aktivste und freundlichste Community.', 'Main Awards', 3, 'Beste Community', 1, 'beste-community', 4),
(5, 'Archivkategorie 2025.', 'Main Awards', 3, 'VTuber des Jahres', 2, 'vtuber-des-jahres', 1),
(6, 'Archivkategorie 2025.', 'Performance', 3, 'Bestes Live Event', 2, 'bestes-live-event', 2),
(7, 'Archivkategorie 2025.', 'Clips & Highlights', 3, 'Clip des Jahres', 2, 'clip-des-jahres', 3),
(8, 'Archivkategorie 2024.', 'Main Awards', 3, 'VTuber des Jahres', 3, 'vtuber-des-jahres', 1),
(9, 'Archivkategorie 2024.', 'Clips & Highlights', 3, 'Clip des Jahres', 3, 'clip-des-jahres', 2),
(10, 'Archivkategorie 2023.', 'Main Awards', 3, 'VTuber des Jahres', 4, 'vtuber-des-jahres', 1);
INSERT INTO "VoteBallots" ("Id", "SeasonId", "Status", "SubmittedAt", "SubmittedByTwitchId") VALUES
(1, 1, 'submitted', '2026-06-11T12:00:00+00:00', 'twitch_vote_1'),
(2, 1, 'submitted', '2026-06-11T12:05:00+00:00', 'twitch_vote_2');
INSERT INTO "Candidates" ("Id", "CategoryId", "ChannelSlug", "DisplayName", "Platform", "SeasonId") VALUES
(1, 1, '@hoshimimiyu', 'Hoshimi Miyu', 'Twitch', 1),
(2, 1, '@kurainu', 'Kurainu', 'Twitch', 1),
(3, 1, '@shiroch', 'Shiro Ch.', 'Twitch', 1),
(4, 2, '@kurainu', 'Kurainu 3D Live', 'Twitch', 1),
(5, 2, '@aoisakura', 'Aoi Sakura Showcase', 'YouTube', 1),
(6, 3, '@pyonkichikingdom', 'Pyonkichi Kingdom', 'Twitch', 1),
(7, 4, '@moonrelay', 'Moonrelay', 'Twitch', 1),
(8, 5, '@hoshimimiyu', 'Hoshimi Miyu', 'Twitch', 2),
(9, 6, '@kurainu', 'Kurainu 3D Live', 'Twitch', 2),
(10, 7, '@pyonkichikingdom', 'Pyonkichi Kingdom', 'Twitch', 2),
(11, 8, '@aoisakura', 'Aoi Sakura', 'YouTube', 3),
(12, 9, '@starbyte', 'Starbyte', 'Twitch', 3),
(13, 10, '@tenshivox', 'Tenshi Vox', 'Twitch', 4);
INSERT INTO "Nominations" ("Id", "CandidateId", "CandidateText", "CategoryId", "CreatedAt", "SeasonId", "SubmittedByTwitchId") VALUES
(1, NULL, 'Hoshimi Miyu', 1, '2026-06-10T13:00:00+00:00', 1, 'twitch_hoshi'),
(2, NULL, 'Kurainu 3D Live', 2, '2026-06-10T14:00:00+00:00', 1, 'twitch_kurainu');
INSERT INTO "Results" ("Id", "CandidateId", "CategoryName", "SeasonId") VALUES
(1, 8, 'VTuber des Jahres', 2),
(2, 9, 'Bestes Live Event', 2),
(3, 10, 'Clip des Jahres', 2),
(4, 11, 'VTuber des Jahres', 3),
(5, 12, 'Clip des Jahres', 3),
(6, 13, 'VTuber des Jahres', 4);
INSERT INTO "VoteEntries" ("Id", "BallotId", "CandidateId", "CategoryId") VALUES
(1, 1, 1, 1),
(2, 1, 4, 2),
(3, 2, 2, 1),
(4, 2, 6, 3);
SELECT setval(pg_get_serial_sequence('"Seasons"', 'Id'), COALESCE(MAX("Id"), 1), true) FROM "Seasons";
SELECT setval(pg_get_serial_sequence('"Categories"', 'Id'), COALESCE(MAX("Id"), 1), true) FROM "Categories";
SELECT setval(pg_get_serial_sequence('"VoteBallots"', 'Id'), COALESCE(MAX("Id"), 1), true) FROM "VoteBallots";
SELECT setval(pg_get_serial_sequence('"Candidates"', 'Id'), COALESCE(MAX("Id"), 1), true) FROM "Candidates";
SELECT setval(pg_get_serial_sequence('"Nominations"', 'Id'), COALESCE(MAX("Id"), 1), true) FROM "Nominations";
SELECT setval(pg_get_serial_sequence('"Results"', 'Id'), COALESCE(MAX("Id"), 1), true) FROM "Results";
SELECT setval(pg_get_serial_sequence('"VoteEntries"', 'Id'), COALESCE(MAX("Id"), 1), true) FROM "VoteEntries";
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20260617060000_InitialCreate', '8.0.11');
+257
View File
@@ -0,0 +1,257 @@
CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
"MigrationId" character varying(150) NOT NULL,
"ProductVersion" character varying(32) NOT NULL,
CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
);
START TRANSACTION;
CREATE TABLE "Seasons" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY,
"Year" integer NOT NULL,
"Name" character varying(160) NOT NULL,
"IsCurrent" boolean NOT NULL,
"IsCommunityOnly" boolean NOT NULL,
"CurrentPhase" character varying(60) NOT NULL,
"NominationStartsAt" date NOT NULL,
"NominationEndsAt" date NOT NULL,
"VotingStartsAt" date NOT NULL,
"VotingEndsAt" date NOT NULL,
"ReviewStartsAt" date NOT NULL,
"ReviewEndsAt" date NOT NULL,
"ShowDate" date NOT NULL,
CONSTRAINT "PK_Seasons" PRIMARY KEY ("Id")
);
CREATE TABLE "Categories" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY,
"SeasonId" integer NOT NULL,
"GroupName" character varying(80) NOT NULL,
"Name" character varying(120) NOT NULL,
"Slug" text NOT NULL,
"Description" character varying(400) NOT NULL,
"SortOrder" integer NOT NULL,
"MaxNomineesPerUser" integer NOT NULL,
CONSTRAINT "PK_Categories" PRIMARY KEY ("Id"),
CONSTRAINT "FK_Categories_Seasons_SeasonId" FOREIGN KEY ("SeasonId") REFERENCES "Seasons" ("Id") ON DELETE CASCADE
);
CREATE TABLE "VoteBallots" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY,
"SeasonId" integer NOT NULL,
"SubmittedByTwitchId" character varying(120) NOT NULL,
"Status" character varying(30) NOT NULL,
"SubmittedAt" timestamp with time zone NOT NULL,
CONSTRAINT "PK_VoteBallots" PRIMARY KEY ("Id"),
CONSTRAINT "FK_VoteBallots_Seasons_SeasonId" FOREIGN KEY ("SeasonId") REFERENCES "Seasons" ("Id") ON DELETE CASCADE
);
CREATE TABLE "Candidates" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY,
"SeasonId" integer NOT NULL,
"CategoryId" integer NOT NULL,
"DisplayName" character varying(120) NOT NULL,
"ChannelSlug" character varying(120) NOT NULL,
"Platform" character varying(40) NOT NULL,
CONSTRAINT "PK_Candidates" PRIMARY KEY ("Id"),
CONSTRAINT "FK_Candidates_Categories_CategoryId" FOREIGN KEY ("CategoryId") REFERENCES "Categories" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_Candidates_Seasons_SeasonId" FOREIGN KEY ("SeasonId") REFERENCES "Seasons" ("Id") ON DELETE CASCADE
);
CREATE TABLE "Nominations" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY,
"SeasonId" integer NOT NULL,
"CategoryId" integer NOT NULL,
"SubmittedByTwitchId" character varying(120) NOT NULL,
"CandidateId" integer,
"CandidateText" character varying(120),
"CreatedAt" timestamp with time zone NOT NULL,
CONSTRAINT "PK_Nominations" PRIMARY KEY ("Id"),
CONSTRAINT "FK_Nominations_Candidates_CandidateId" FOREIGN KEY ("CandidateId") REFERENCES "Candidates" ("Id"),
CONSTRAINT "FK_Nominations_Categories_CategoryId" FOREIGN KEY ("CategoryId") REFERENCES "Categories" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_Nominations_Seasons_SeasonId" FOREIGN KEY ("SeasonId") REFERENCES "Seasons" ("Id") ON DELETE CASCADE
);
CREATE TABLE "Results" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY,
"SeasonId" integer NOT NULL,
"CandidateId" integer NOT NULL,
"CategoryName" character varying(120) NOT NULL,
CONSTRAINT "PK_Results" PRIMARY KEY ("Id"),
CONSTRAINT "FK_Results_Candidates_CandidateId" FOREIGN KEY ("CandidateId") REFERENCES "Candidates" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_Results_Seasons_SeasonId" FOREIGN KEY ("SeasonId") REFERENCES "Seasons" ("Id") ON DELETE CASCADE
);
CREATE TABLE "VoteEntries" (
"Id" integer GENERATED BY DEFAULT AS IDENTITY,
"BallotId" integer NOT NULL,
"CategoryId" integer NOT NULL,
"CandidateId" integer NOT NULL,
CONSTRAINT "PK_VoteEntries" PRIMARY KEY ("Id"),
CONSTRAINT "FK_VoteEntries_Candidates_CandidateId" FOREIGN KEY ("CandidateId") REFERENCES "Candidates" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_VoteEntries_Categories_CategoryId" FOREIGN KEY ("CategoryId") REFERENCES "Categories" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_VoteEntries_VoteBallots_BallotId" FOREIGN KEY ("BallotId") REFERENCES "VoteBallots" ("Id") ON DELETE CASCADE
);
INSERT INTO "Seasons" ("Id", "CurrentPhase", "IsCommunityOnly", "IsCurrent", "Name", "NominationEndsAt", "NominationStartsAt", "ReviewEndsAt", "ReviewStartsAt", "ShowDate", "VotingEndsAt", "VotingStartsAt", "Year")
VALUES (1, 'Community Voting', TRUE, TRUE, 'VTuber Star Awards 2026', DATE '2026-05-31', DATE '2026-05-01', DATE '2026-07-10', DATE '2026-07-01', DATE '2026-07-20', DATE '2026-06-30', DATE '2026-06-01', 2026);
INSERT INTO "Seasons" ("Id", "CurrentPhase", "IsCommunityOnly", "IsCurrent", "Name", "NominationEndsAt", "NominationStartsAt", "ReviewEndsAt", "ReviewStartsAt", "ShowDate", "VotingEndsAt", "VotingStartsAt", "Year")
VALUES (2, 'Archived', TRUE, FALSE, 'VTuber Star Awards 2025', DATE '2025-05-31', DATE '2025-05-01', DATE '2025-07-10', DATE '2025-07-01', DATE '2025-07-20', DATE '2025-06-30', DATE '2025-06-01', 2025);
INSERT INTO "Seasons" ("Id", "CurrentPhase", "IsCommunityOnly", "IsCurrent", "Name", "NominationEndsAt", "NominationStartsAt", "ReviewEndsAt", "ReviewStartsAt", "ShowDate", "VotingEndsAt", "VotingStartsAt", "Year")
VALUES (3, 'Archived', TRUE, FALSE, 'VTuber Star Awards 2024', DATE '2024-05-31', DATE '2024-05-01', DATE '2024-07-10', DATE '2024-07-01', DATE '2024-07-20', DATE '2024-06-30', DATE '2024-06-01', 2024);
INSERT INTO "Seasons" ("Id", "CurrentPhase", "IsCommunityOnly", "IsCurrent", "Name", "NominationEndsAt", "NominationStartsAt", "ReviewEndsAt", "ReviewStartsAt", "ShowDate", "VotingEndsAt", "VotingStartsAt", "Year")
VALUES (4, 'Archived', TRUE, FALSE, 'VTuber Star Awards 2023', DATE '2023-05-31', DATE '2023-05-01', DATE '2023-07-10', DATE '2023-07-01', DATE '2023-07-20', DATE '2023-06-30', DATE '2023-06-01', 2023);
INSERT INTO "Categories" ("Id", "Description", "GroupName", "MaxNomineesPerUser", "Name", "SeasonId", "Slug", "SortOrder")
VALUES (1, 'Die groesste Auszeichnung des Jahres.', 'Main Awards', 3, 'VTuber des Jahres', 1, 'vtuber-des-jahres', 1);
INSERT INTO "Categories" ("Id", "Description", "GroupName", "MaxNomineesPerUser", "Name", "SeasonId", "Slug", "SortOrder")
VALUES (2, 'Events, Konzerte und 3D-Shows.', 'Performance', 3, 'Bestes Live Event', 1, 'bestes-live-event', 2);
INSERT INTO "Categories" ("Id", "Description", "GroupName", "MaxNomineesPerUser", "Name", "SeasonId", "Slug", "SortOrder")
VALUES (3, 'Der lustigste oder emotionalste Clip des Jahres.', 'Clips & Highlights', 3, 'Clip des Jahres', 1, 'clip-des-jahres', 3);
INSERT INTO "Categories" ("Id", "Description", "GroupName", "MaxNomineesPerUser", "Name", "SeasonId", "Slug", "SortOrder")
VALUES (4, 'Die aktivste und freundlichste Community.', 'Main Awards', 3, 'Beste Community', 1, 'beste-community', 4);
INSERT INTO "Categories" ("Id", "Description", "GroupName", "MaxNomineesPerUser", "Name", "SeasonId", "Slug", "SortOrder")
VALUES (5, 'Archivkategorie 2025.', 'Main Awards', 3, 'VTuber des Jahres', 2, 'vtuber-des-jahres', 1);
INSERT INTO "Categories" ("Id", "Description", "GroupName", "MaxNomineesPerUser", "Name", "SeasonId", "Slug", "SortOrder")
VALUES (6, 'Archivkategorie 2025.', 'Performance', 3, 'Bestes Live Event', 2, 'bestes-live-event', 2);
INSERT INTO "Categories" ("Id", "Description", "GroupName", "MaxNomineesPerUser", "Name", "SeasonId", "Slug", "SortOrder")
VALUES (7, 'Archivkategorie 2025.', 'Clips & Highlights', 3, 'Clip des Jahres', 2, 'clip-des-jahres', 3);
INSERT INTO "Categories" ("Id", "Description", "GroupName", "MaxNomineesPerUser", "Name", "SeasonId", "Slug", "SortOrder")
VALUES (8, 'Archivkategorie 2024.', 'Main Awards', 3, 'VTuber des Jahres', 3, 'vtuber-des-jahres', 1);
INSERT INTO "Categories" ("Id", "Description", "GroupName", "MaxNomineesPerUser", "Name", "SeasonId", "Slug", "SortOrder")
VALUES (9, 'Archivkategorie 2024.', 'Clips & Highlights', 3, 'Clip des Jahres', 3, 'clip-des-jahres', 2);
INSERT INTO "Categories" ("Id", "Description", "GroupName", "MaxNomineesPerUser", "Name", "SeasonId", "Slug", "SortOrder")
VALUES (10, 'Archivkategorie 2023.', 'Main Awards', 3, 'VTuber des Jahres', 4, 'vtuber-des-jahres', 1);
INSERT INTO "VoteBallots" ("Id", "SeasonId", "Status", "SubmittedAt", "SubmittedByTwitchId")
VALUES (1, 1, 'submitted', TIMESTAMPTZ '2026-06-11T12:00:00+00:00', 'twitch_vote_1');
INSERT INTO "VoteBallots" ("Id", "SeasonId", "Status", "SubmittedAt", "SubmittedByTwitchId")
VALUES (2, 1, 'submitted', TIMESTAMPTZ '2026-06-11T12:05:00+00:00', 'twitch_vote_2');
INSERT INTO "Candidates" ("Id", "CategoryId", "ChannelSlug", "DisplayName", "Platform", "SeasonId")
VALUES (1, 1, '@hoshimimiyu', 'Hoshimi Miyu', 'Twitch', 1);
INSERT INTO "Candidates" ("Id", "CategoryId", "ChannelSlug", "DisplayName", "Platform", "SeasonId")
VALUES (2, 1, '@kurainu', 'Kurainu', 'Twitch', 1);
INSERT INTO "Candidates" ("Id", "CategoryId", "ChannelSlug", "DisplayName", "Platform", "SeasonId")
VALUES (3, 1, '@shiroch', 'Shiro Ch.', 'Twitch', 1);
INSERT INTO "Candidates" ("Id", "CategoryId", "ChannelSlug", "DisplayName", "Platform", "SeasonId")
VALUES (4, 2, '@kurainu', 'Kurainu 3D Live', 'Twitch', 1);
INSERT INTO "Candidates" ("Id", "CategoryId", "ChannelSlug", "DisplayName", "Platform", "SeasonId")
VALUES (5, 2, '@aoisakura', 'Aoi Sakura Showcase', 'YouTube', 1);
INSERT INTO "Candidates" ("Id", "CategoryId", "ChannelSlug", "DisplayName", "Platform", "SeasonId")
VALUES (6, 3, '@pyonkichikingdom', 'Pyonkichi Kingdom', 'Twitch', 1);
INSERT INTO "Candidates" ("Id", "CategoryId", "ChannelSlug", "DisplayName", "Platform", "SeasonId")
VALUES (7, 4, '@moonrelay', 'Moonrelay', 'Twitch', 1);
INSERT INTO "Candidates" ("Id", "CategoryId", "ChannelSlug", "DisplayName", "Platform", "SeasonId")
VALUES (8, 5, '@hoshimimiyu', 'Hoshimi Miyu', 'Twitch', 2);
INSERT INTO "Candidates" ("Id", "CategoryId", "ChannelSlug", "DisplayName", "Platform", "SeasonId")
VALUES (9, 6, '@kurainu', 'Kurainu 3D Live', 'Twitch', 2);
INSERT INTO "Candidates" ("Id", "CategoryId", "ChannelSlug", "DisplayName", "Platform", "SeasonId")
VALUES (10, 7, '@pyonkichikingdom', 'Pyonkichi Kingdom', 'Twitch', 2);
INSERT INTO "Candidates" ("Id", "CategoryId", "ChannelSlug", "DisplayName", "Platform", "SeasonId")
VALUES (11, 8, '@aoisakura', 'Aoi Sakura', 'YouTube', 3);
INSERT INTO "Candidates" ("Id", "CategoryId", "ChannelSlug", "DisplayName", "Platform", "SeasonId")
VALUES (12, 9, '@starbyte', 'Starbyte', 'Twitch', 3);
INSERT INTO "Candidates" ("Id", "CategoryId", "ChannelSlug", "DisplayName", "Platform", "SeasonId")
VALUES (13, 10, '@tenshivox', 'Tenshi Vox', 'Twitch', 4);
INSERT INTO "Nominations" ("Id", "CandidateId", "CandidateText", "CategoryId", "CreatedAt", "SeasonId", "SubmittedByTwitchId")
VALUES (1, NULL, 'Hoshimi Miyu', 1, TIMESTAMPTZ '2026-06-10T13:00:00+00:00', 1, 'twitch_hoshi');
INSERT INTO "Nominations" ("Id", "CandidateId", "CandidateText", "CategoryId", "CreatedAt", "SeasonId", "SubmittedByTwitchId")
VALUES (2, NULL, 'Kurainu 3D Live', 2, TIMESTAMPTZ '2026-06-10T14:00:00+00:00', 1, 'twitch_kurainu');
INSERT INTO "Results" ("Id", "CandidateId", "CategoryName", "SeasonId")
VALUES (1, 8, 'VTuber des Jahres', 2);
INSERT INTO "Results" ("Id", "CandidateId", "CategoryName", "SeasonId")
VALUES (2, 9, 'Bestes Live Event', 2);
INSERT INTO "Results" ("Id", "CandidateId", "CategoryName", "SeasonId")
VALUES (3, 10, 'Clip des Jahres', 2);
INSERT INTO "Results" ("Id", "CandidateId", "CategoryName", "SeasonId")
VALUES (4, 11, 'VTuber des Jahres', 3);
INSERT INTO "Results" ("Id", "CandidateId", "CategoryName", "SeasonId")
VALUES (5, 12, 'Clip des Jahres', 3);
INSERT INTO "Results" ("Id", "CandidateId", "CategoryName", "SeasonId")
VALUES (6, 13, 'VTuber des Jahres', 4);
INSERT INTO "VoteEntries" ("Id", "BallotId", "CandidateId", "CategoryId")
VALUES (1, 1, 1, 1);
INSERT INTO "VoteEntries" ("Id", "BallotId", "CandidateId", "CategoryId")
VALUES (2, 1, 4, 2);
INSERT INTO "VoteEntries" ("Id", "BallotId", "CandidateId", "CategoryId")
VALUES (3, 2, 2, 1);
INSERT INTO "VoteEntries" ("Id", "BallotId", "CandidateId", "CategoryId")
VALUES (4, 2, 6, 3);
CREATE INDEX "IX_Candidates_CategoryId" ON "Candidates" ("CategoryId");
CREATE INDEX "IX_Candidates_SeasonId" ON "Candidates" ("SeasonId");
CREATE UNIQUE INDEX "IX_Categories_SeasonId_Slug" ON "Categories" ("SeasonId", "Slug");
CREATE INDEX "IX_Nominations_CandidateId" ON "Nominations" ("CandidateId");
CREATE INDEX "IX_Nominations_CategoryId" ON "Nominations" ("CategoryId");
CREATE INDEX "IX_Nominations_SeasonId" ON "Nominations" ("SeasonId");
CREATE INDEX "IX_Results_CandidateId" ON "Results" ("CandidateId");
CREATE INDEX "IX_Results_SeasonId" ON "Results" ("SeasonId");
CREATE UNIQUE INDEX "IX_Seasons_Year" ON "Seasons" ("Year");
CREATE INDEX "IX_VoteBallots_SeasonId" ON "VoteBallots" ("SeasonId");
CREATE INDEX "IX_VoteEntries_BallotId" ON "VoteEntries" ("BallotId");
CREATE INDEX "IX_VoteEntries_CandidateId" ON "VoteEntries" ("CandidateId");
CREATE INDEX "IX_VoteEntries_CategoryId" ON "VoteEntries" ("CategoryId");
SELECT setval(
pg_get_serial_sequence('"Seasons"', 'Id'),
GREATEST(
(SELECT MAX("Id") FROM "Seasons") + 1,
nextval(pg_get_serial_sequence('"Seasons"', 'Id'))),
false);
SELECT setval(
pg_get_serial_sequence('"Categories"', 'Id'),
GREATEST(
(SELECT MAX("Id") FROM "Categories") + 1,
nextval(pg_get_serial_sequence('"Categories"', 'Id'))),
false);
SELECT setval(
pg_get_serial_sequence('"VoteBallots"', 'Id'),
GREATEST(
(SELECT MAX("Id") FROM "VoteBallots") + 1,
nextval(pg_get_serial_sequence('"VoteBallots"', 'Id'))),
false);
SELECT setval(
pg_get_serial_sequence('"Candidates"', 'Id'),
GREATEST(
(SELECT MAX("Id") FROM "Candidates") + 1,
nextval(pg_get_serial_sequence('"Candidates"', 'Id'))),
false);
SELECT setval(
pg_get_serial_sequence('"Nominations"', 'Id'),
GREATEST(
(SELECT MAX("Id") FROM "Nominations") + 1,
nextval(pg_get_serial_sequence('"Nominations"', 'Id'))),
false);
SELECT setval(
pg_get_serial_sequence('"Results"', 'Id'),
GREATEST(
(SELECT MAX("Id") FROM "Results") + 1,
nextval(pg_get_serial_sequence('"Results"', 'Id'))),
false);
SELECT setval(
pg_get_serial_sequence('"VoteEntries"', 'Id'),
GREATEST(
(SELECT MAX("Id") FROM "VoteEntries") + 1,
nextval(pg_get_serial_sequence('"VoteEntries"', 'Id'))),
false);
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20260617060000_InitialCreate', '8.0.11');
COMMIT;