From f137595a5ab15ebf2620f2713fa4e07b4252ad46 Mon Sep 17 00:00:00 2001 From: Kevin Matsubara Date: Sun, 6 Apr 2025 20:06:01 +0200 Subject: [PATCH] Add migration to add Match and League entities. --- ...0432_AddMatchAndLeagueEntities.Designer.cs | 282 ++++++++++++ ...0250406180432_AddMatchAndLeagueEntities.cs | 406 ++++++++++++++++++ ...eadBallZoneLeagueDbContextModelSnapshot.cs | 168 +++++++- EntityFrameworkCore.Domain/Team.cs | 1 + 4 files changed, 838 insertions(+), 19 deletions(-) create mode 100644 EntityFrameworkCore.Data/Migrations/20250406180432_AddMatchAndLeagueEntities.Designer.cs create mode 100644 EntityFrameworkCore.Data/Migrations/20250406180432_AddMatchAndLeagueEntities.cs diff --git a/EntityFrameworkCore.Data/Migrations/20250406180432_AddMatchAndLeagueEntities.Designer.cs b/EntityFrameworkCore.Data/Migrations/20250406180432_AddMatchAndLeagueEntities.Designer.cs new file mode 100644 index 0000000..bea232e --- /dev/null +++ b/EntityFrameworkCore.Data/Migrations/20250406180432_AddMatchAndLeagueEntities.Designer.cs @@ -0,0 +1,282 @@ +// +using System; +using EntityFrameworkCore.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace EntityFrameworkCore.Data.Migrations +{ + [DbContext(typeof(DeadBallZoneLeagueDbContext))] + [Migration("20250406180432_AddMatchAndLeagueEntities")] + partial class AddMatchAndLeagueEntities + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "9.0.3"); + + modelBuilder.Entity("EntityFrameworkCore.Domain.Coach", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedDate") + .HasColumnType("TEXT"); + + b.Property("ModifiedBy") + .HasColumnType("TEXT"); + + b.Property("ModifiedDate") + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Coaches"); + }); + + modelBuilder.Entity("EntityFrameworkCore.Domain.League", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedDate") + .HasColumnType("TEXT"); + + b.Property("ModifiedBy") + .HasColumnType("TEXT"); + + b.Property("ModifiedDate") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Leagues"); + }); + + modelBuilder.Entity("EntityFrameworkCore.Domain.Match", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AwayTeamId") + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedDate") + .HasColumnType("TEXT"); + + b.Property("Date") + .HasColumnType("TEXT"); + + b.Property("HomeTeamId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("TEXT"); + + b.Property("ModifiedDate") + .HasColumnType("TEXT"); + + b.Property("TicketPrice") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Matches"); + }); + + modelBuilder.Entity("EntityFrameworkCore.Domain.Team", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CoachId") + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedDate") + .HasColumnType("TEXT"); + + b.Property("LeagueId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("TEXT"); + + b.Property("ModifiedDate") + .HasColumnType("TEXT"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("TeamId") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Teams"); + + b.HasData( + new + { + Id = 1, + CoachId = 0, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Neo Delhi" + }, + new + { + Id = 2, + CoachId = 0, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Voodoo" + }, + new + { + Id = 3, + CoachId = 0, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Penal X" + }, + new + { + Id = 4, + CoachId = 0, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Neo Tokyo" + }, + new + { + Id = 5, + CoachId = 0, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Neo Barcelona" + }, + new + { + Id = 6, + CoachId = 0, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Neo Manchester" + }, + new + { + Id = 7, + CoachId = 0, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Neo Bangkok" + }, + new + { + Id = 8, + CoachId = 0, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Neo Amsterdam" + }, + new + { + Id = 9, + CoachId = 0, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Killaklowns" + }, + new + { + Id = 10, + CoachId = 0, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Sol" + }, + new + { + Id = 11, + CoachId = 0, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "DEC" + }, + new + { + Id = 12, + CoachId = 0, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Leopards" + }, + new + { + Id = 13, + CoachId = 0, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Harlequins" + }, + new + { + Id = 14, + CoachId = 0, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Gladiators" + }, + new + { + Id = 15, + CoachId = 0, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Fiz-O" + }); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/EntityFrameworkCore.Data/Migrations/20250406180432_AddMatchAndLeagueEntities.cs b/EntityFrameworkCore.Data/Migrations/20250406180432_AddMatchAndLeagueEntities.cs new file mode 100644 index 0000000..cc43115 --- /dev/null +++ b/EntityFrameworkCore.Data/Migrations/20250406180432_AddMatchAndLeagueEntities.cs @@ -0,0 +1,406 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional + +namespace EntityFrameworkCore.Data.Migrations +{ + /// + public partial class AddMatchAndLeagueEntities : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropPrimaryKey( + name: "PK_Teams", + table: "Teams"); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "TeamId", + keyValue: 1); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "TeamId", + keyValue: 2); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "TeamId", + keyValue: 3); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "TeamId", + keyValue: 4); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "TeamId", + keyValue: 5); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "TeamId", + keyValue: 6); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "TeamId", + keyValue: 7); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "TeamId", + keyValue: 8); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "TeamId", + keyValue: 9); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "TeamId", + keyValue: 10); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "TeamId", + keyValue: 11); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "TeamId", + keyValue: 12); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "TeamId", + keyValue: 13); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "TeamId", + keyValue: 14); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "TeamId", + keyValue: 15); + + migrationBuilder.AlterColumn( + name: "TeamId", + table: "Teams", + type: "INTEGER", + nullable: true, + oldClrType: typeof(int), + oldType: "INTEGER") + .OldAnnotation("Sqlite:Autoincrement", true); + + migrationBuilder.AddColumn( + name: "Id", + table: "Teams", + type: "INTEGER", + nullable: false, + defaultValue: 0) + .Annotation("Sqlite:Autoincrement", true); + + migrationBuilder.AddColumn( + name: "CoachId", + table: "Teams", + type: "INTEGER", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "CreatedBy", + table: "Teams", + type: "TEXT", + nullable: true); + + migrationBuilder.AddColumn( + name: "LeagueId", + table: "Teams", + type: "INTEGER", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "ModifiedBy", + table: "Teams", + type: "TEXT", + nullable: true); + + migrationBuilder.AddColumn( + name: "ModifiedDate", + table: "Teams", + type: "TEXT", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddColumn( + name: "CreatedBy", + table: "Coaches", + type: "TEXT", + nullable: true); + + migrationBuilder.AddColumn( + name: "ModifiedBy", + table: "Coaches", + type: "TEXT", + nullable: true); + + migrationBuilder.AddColumn( + name: "ModifiedDate", + table: "Coaches", + type: "TEXT", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddPrimaryKey( + name: "PK_Teams", + table: "Teams", + column: "Id"); + + migrationBuilder.CreateTable( + name: "Leagues", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + CreatedDate = table.Column(type: "TEXT", nullable: false), + ModifiedDate = table.Column(type: "TEXT", nullable: false), + CreatedBy = table.Column(type: "TEXT", nullable: true), + ModifiedBy = table.Column(type: "TEXT", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Leagues", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Matches", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + HomeTeamId = table.Column(type: "INTEGER", nullable: false), + AwayTeamId = table.Column(type: "INTEGER", nullable: false), + TicketPrice = table.Column(type: "TEXT", nullable: false), + Date = table.Column(type: "TEXT", nullable: false), + CreatedDate = table.Column(type: "TEXT", nullable: false), + ModifiedDate = table.Column(type: "TEXT", nullable: false), + CreatedBy = table.Column(type: "TEXT", nullable: true), + ModifiedBy = table.Column(type: "TEXT", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Matches", x => x.Id); + }); + + migrationBuilder.InsertData( + table: "Teams", + columns: new[] { "Id", "CoachId", "CreatedBy", "CreatedDate", "LeagueId", "ModifiedBy", "ModifiedDate", "Name", "TeamId" }, + values: new object[,] + { + { 1, 0, null, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), 0, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Neo Delhi", null }, + { 2, 0, null, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), 0, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Voodoo", null }, + { 3, 0, null, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), 0, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Penal X", null }, + { 4, 0, null, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), 0, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Neo Tokyo", null }, + { 5, 0, null, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), 0, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Neo Barcelona", null }, + { 6, 0, null, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), 0, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Neo Manchester", null }, + { 7, 0, null, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), 0, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Neo Bangkok", null }, + { 8, 0, null, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), 0, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Neo Amsterdam", null }, + { 9, 0, null, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), 0, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Killaklowns", null }, + { 10, 0, null, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), 0, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Sol", null }, + { 11, 0, null, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), 0, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "DEC", null }, + { 12, 0, null, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), 0, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Leopards", null }, + { 13, 0, null, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), 0, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Harlequins", null }, + { 14, 0, null, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), 0, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Gladiators", null }, + { 15, 0, null, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), 0, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "Fiz-O", null } + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Leagues"); + + migrationBuilder.DropTable( + name: "Matches"); + + migrationBuilder.DropPrimaryKey( + name: "PK_Teams", + table: "Teams"); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "Id", + keyColumnType: "INTEGER", + keyValue: 1); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "Id", + keyColumnType: "INTEGER", + keyValue: 2); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "Id", + keyColumnType: "INTEGER", + keyValue: 3); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "Id", + keyColumnType: "INTEGER", + keyValue: 4); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "Id", + keyColumnType: "INTEGER", + keyValue: 5); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "Id", + keyColumnType: "INTEGER", + keyValue: 6); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "Id", + keyColumnType: "INTEGER", + keyValue: 7); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "Id", + keyColumnType: "INTEGER", + keyValue: 8); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "Id", + keyColumnType: "INTEGER", + keyValue: 9); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "Id", + keyColumnType: "INTEGER", + keyValue: 10); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "Id", + keyColumnType: "INTEGER", + keyValue: 11); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "Id", + keyColumnType: "INTEGER", + keyValue: 12); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "Id", + keyColumnType: "INTEGER", + keyValue: 13); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "Id", + keyColumnType: "INTEGER", + keyValue: 14); + + migrationBuilder.DeleteData( + table: "Teams", + keyColumn: "Id", + keyColumnType: "INTEGER", + keyValue: 15); + + migrationBuilder.DropColumn( + name: "Id", + table: "Teams"); + + migrationBuilder.DropColumn( + name: "CoachId", + table: "Teams"); + + migrationBuilder.DropColumn( + name: "CreatedBy", + table: "Teams"); + + migrationBuilder.DropColumn( + name: "LeagueId", + table: "Teams"); + + migrationBuilder.DropColumn( + name: "ModifiedBy", + table: "Teams"); + + migrationBuilder.DropColumn( + name: "ModifiedDate", + table: "Teams"); + + migrationBuilder.DropColumn( + name: "CreatedBy", + table: "Coaches"); + + migrationBuilder.DropColumn( + name: "ModifiedBy", + table: "Coaches"); + + migrationBuilder.DropColumn( + name: "ModifiedDate", + table: "Coaches"); + + migrationBuilder.AlterColumn( + name: "TeamId", + table: "Teams", + type: "INTEGER", + nullable: false, + defaultValue: 0, + oldClrType: typeof(int), + oldType: "INTEGER", + oldNullable: true) + .Annotation("Sqlite:Autoincrement", true); + + migrationBuilder.AddPrimaryKey( + name: "PK_Teams", + table: "Teams", + column: "TeamId"); + + migrationBuilder.InsertData( + table: "Teams", + columns: new[] { "TeamId", "CreatedDate", "Name" }, + values: new object[,] + { + { 1, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), "Neo Delhi" }, + { 2, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), "Voodoo" }, + { 3, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), "Penal X" }, + { 4, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), "Neo Tokyo" }, + { 5, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), "Neo Barcelona" }, + { 6, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), "Neo Manchester" }, + { 7, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), "Neo Bangkok" }, + { 8, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), "Neo Amsterdam" }, + { 9, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), "Killaklowns" }, + { 10, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), "Sol" }, + { 11, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), "DEC" }, + { 12, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), "Leopards" }, + { 13, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), "Harlequins" }, + { 14, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), "Gladiators" }, + { 15, new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), "Fiz-O" } + }); + } + } +} diff --git a/EntityFrameworkCore.Data/Migrations/DeadBallZoneLeagueDbContextModelSnapshot.cs b/EntityFrameworkCore.Data/Migrations/DeadBallZoneLeagueDbContextModelSnapshot.cs index 63ed0d7..37c7e72 100644 --- a/EntityFrameworkCore.Data/Migrations/DeadBallZoneLeagueDbContextModelSnapshot.cs +++ b/EntityFrameworkCore.Data/Migrations/DeadBallZoneLeagueDbContextModelSnapshot.cs @@ -23,123 +23,253 @@ namespace EntityFrameworkCore.Data.Migrations .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); + b.Property("CreatedBy") + .HasColumnType("TEXT"); + b.Property("CreatedDate") .HasColumnType("TEXT"); + b.Property("ModifiedBy") + .HasColumnType("TEXT"); + + b.Property("ModifiedDate") + .HasColumnType("TEXT"); + b.Property("Name") .IsRequired() .HasColumnType("TEXT"); b.HasKey("Id"); - b.ToTable("Coaches", (string)null); + b.ToTable("Coaches"); + }); + + modelBuilder.Entity("EntityFrameworkCore.Domain.League", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedDate") + .HasColumnType("TEXT"); + + b.Property("ModifiedBy") + .HasColumnType("TEXT"); + + b.Property("ModifiedDate") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Leagues"); + }); + + modelBuilder.Entity("EntityFrameworkCore.Domain.Match", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AwayTeamId") + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedDate") + .HasColumnType("TEXT"); + + b.Property("Date") + .HasColumnType("TEXT"); + + b.Property("HomeTeamId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("TEXT"); + + b.Property("ModifiedDate") + .HasColumnType("TEXT"); + + b.Property("TicketPrice") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Matches"); }); modelBuilder.Entity("EntityFrameworkCore.Domain.Team", b => { - b.Property("TeamId") + b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); + b.Property("CoachId") + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + b.Property("CreatedDate") .HasColumnType("TEXT"); + b.Property("LeagueId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("TEXT"); + + b.Property("ModifiedDate") + .HasColumnType("TEXT"); + b.Property("Name") .HasColumnType("TEXT"); - b.HasKey("TeamId"); + b.Property("TeamId") + .HasColumnType("INTEGER"); - b.ToTable("Teams", (string)null); + b.HasKey("Id"); + + b.ToTable("Teams"); b.HasData( new { - TeamId = 1, + Id = 1, + CoachId = 0, CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Name = "Neo Delhi" }, new { - TeamId = 2, + Id = 2, + CoachId = 0, CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Name = "Voodoo" }, new { - TeamId = 3, + Id = 3, + CoachId = 0, CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Name = "Penal X" }, new { - TeamId = 4, + Id = 4, + CoachId = 0, CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Name = "Neo Tokyo" }, new { - TeamId = 5, + Id = 5, + CoachId = 0, CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Name = "Neo Barcelona" }, new { - TeamId = 6, + Id = 6, + CoachId = 0, CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Name = "Neo Manchester" }, new { - TeamId = 7, + Id = 7, + CoachId = 0, CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Name = "Neo Bangkok" }, new { - TeamId = 8, + Id = 8, + CoachId = 0, CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Name = "Neo Amsterdam" }, new { - TeamId = 9, + Id = 9, + CoachId = 0, CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Name = "Killaklowns" }, new { - TeamId = 10, + Id = 10, + CoachId = 0, CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Name = "Sol" }, new { - TeamId = 11, + Id = 11, + CoachId = 0, CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Name = "DEC" }, new { - TeamId = 12, + Id = 12, + CoachId = 0, CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Name = "Leopards" }, new { - TeamId = 13, + Id = 13, + CoachId = 0, CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Name = "Harlequins" }, new { - TeamId = 14, + Id = 14, + CoachId = 0, CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Name = "Gladiators" }, new { - TeamId = 15, + Id = 15, + CoachId = 0, CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 0, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Name = "Fiz-O" }); }); diff --git a/EntityFrameworkCore.Domain/Team.cs b/EntityFrameworkCore.Domain/Team.cs index f8aec7e..375adb2 100644 --- a/EntityFrameworkCore.Domain/Team.cs +++ b/EntityFrameworkCore.Domain/Team.cs @@ -3,6 +3,7 @@ public class Team : BaseDomainModel { public string? Name { get; set; } + public int? TeamId { get; set; } public int LeagueId { get; set; } public int CoachId { get; set; } }