Initial VTuber Awards implementation
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,830 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Backend.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Backend.Migrations
|
||||
{
|
||||
[DbContext(typeof(AwardsDbContext))]
|
||||
partial class AwardsDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(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,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');
|
||||
@@ -0,0 +1,258 @@
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user