From f02538b2814c68d89dd3ab727d6fbde337344fe5 Mon Sep 17 00:00:00 2001 From: Kevin Matsubara Date: Mon, 14 Apr 2025 22:11:01 +0200 Subject: [PATCH] Create migrations for concurrency tokens. --- ...ddConcurrencyCheckVersionToken.Designer.cs | 568 ++++++++++++++++++ ...4200332_AddConcurrencyCheckVersionToken.cs | 301 ++++++++++ ...eadBallZoneLeagueDbContextModelSnapshot.cs | 130 ++-- 3 files changed, 965 insertions(+), 34 deletions(-) create mode 100644 EntityFrameworkCore.Data/Migrations/20250414200332_AddConcurrencyCheckVersionToken.Designer.cs create mode 100644 EntityFrameworkCore.Data/Migrations/20250414200332_AddConcurrencyCheckVersionToken.cs diff --git a/EntityFrameworkCore.Data/Migrations/20250414200332_AddConcurrencyCheckVersionToken.Designer.cs b/EntityFrameworkCore.Data/Migrations/20250414200332_AddConcurrencyCheckVersionToken.Designer.cs new file mode 100644 index 0000000..6933105 --- /dev/null +++ b/EntityFrameworkCore.Data/Migrations/20250414200332_AddConcurrencyCheckVersionToken.Designer.cs @@ -0,0 +1,568 @@ +// +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("20250414200332_AddConcurrencyCheckVersionToken")] + partial class AddConcurrencyCheckVersionToken + { + /// + 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") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("CreatedDate") + .HasColumnType("TEXT"); + + b.Property("ModifiedBy") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("ModifiedDate") + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Version") + .IsConcurrencyToken() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Coaches"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Christian Southgate", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 2, + CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Rob Mann", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 3, + CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Jon Curtis", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 4, + CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Andy Taylor", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 5, + CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Steve Johnson", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 6, + CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Dan Cook", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 7, + CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Ken Jarvis", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 8, + CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Kenny Suzuki", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 9, + CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Gordon Hall", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 10, + CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "John O Dowd", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 11, + CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Julian Widdows", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 12, + CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Andy Williams", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 13, + CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Trevor Williams", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 14, + CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Blake Deathray", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 15, + CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Rock Housebrick", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }); + }); + + modelBuilder.Entity("EntityFrameworkCore.Domain.League", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("CreatedDate") + .HasColumnType("TEXT"); + + b.Property("ModifiedBy") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("ModifiedDate") + .HasColumnType("TEXT"); + + b.Property("Name") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Version") + .IsConcurrencyToken() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Leagues"); + + b.HasData( + new + { + Id = 1, + CreatedDate = new DateTime(2025, 4, 6, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Local League", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 2, + CreatedDate = new DateTime(2025, 4, 6, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "National League", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 3, + CreatedDate = new DateTime(2025, 4, 6, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Geosphere", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 4, + CreatedDate = new DateTime(2025, 4, 6, 17, 7, 27, 33, DateTimeKind.Unspecified), + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Cyber war", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }); + }); + + modelBuilder.Entity("EntityFrameworkCore.Domain.Match", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AwayTeamId") + .HasColumnType("INTEGER"); + + b.Property("AwayTeamScore") + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("CreatedDate") + .HasColumnType("TEXT"); + + b.Property("Date") + .HasColumnType("TEXT"); + + b.Property("HomeTeamId") + .HasColumnType("INTEGER"); + + b.Property("HomeTeamScore") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("ModifiedDate") + .HasColumnType("TEXT"); + + b.Property("TicketPrice") + .HasPrecision(16, 2) + .HasColumnType("TEXT"); + + b.Property("Version") + .IsConcurrencyToken() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("AwayTeamId"); + + b.HasIndex("HomeTeamId"); + + b.ToTable("Matches"); + }); + + modelBuilder.Entity("EntityFrameworkCore.Domain.Team", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CoachId") + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("CreatedDate") + .HasColumnType("TEXT"); + + b.Property("LeagueId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("ModifiedDate") + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Version") + .IsConcurrencyToken() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("CoachId") + .IsUnique(); + + b.HasIndex("LeagueId"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Teams"); + + b.HasData( + new + { + Id = 1, + CoachId = 1, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 2, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Neo Delhi", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 2, + CoachId = 2, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 1, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Voodoo", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 3, + CoachId = 3, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 1, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Penal X", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 4, + CoachId = 4, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 3, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Neo Tokyo", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 5, + CoachId = 5, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 2, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Neo Barcelona", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 6, + CoachId = 6, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 2, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Neo Manchester", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 7, + CoachId = 7, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 3, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Neo Bangkok", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 8, + CoachId = 8, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 3, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Neo Amsterdam", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 9, + CoachId = 9, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 1, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Killaklowns", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 10, + CoachId = 10, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 1, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Sol", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 11, + CoachId = 11, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 4, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "DEC", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 12, + CoachId = 12, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 1, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Leopards", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 13, + CoachId = 13, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 1, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Harlequins", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 14, + CoachId = 14, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 4, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Gladiators", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }, + new + { + Id = 15, + CoachId = 15, + CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), + LeagueId = 1, + ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Name = "Fiz-O", + Version = new Guid("00000000-0000-0000-0000-000000000000") + }); + }); + + modelBuilder.Entity("EntityFrameworkCore.Domain.TeamsAndLeaguesView", b => + { + b.Property("LeagueName") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Name") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.ToTable((string)null); + + b.ToView("vw_TeamsAndLeagues", (string)null); + }); + + modelBuilder.Entity("EntityFrameworkCore.Domain.Match", b => + { + b.HasOne("EntityFrameworkCore.Domain.Team", "AwayTeam") + .WithMany("AwayMatches") + .HasForeignKey("AwayTeamId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("EntityFrameworkCore.Domain.Team", "HomeTeam") + .WithMany("HomeMatches") + .HasForeignKey("HomeTeamId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("AwayTeam"); + + b.Navigation("HomeTeam"); + }); + + modelBuilder.Entity("EntityFrameworkCore.Domain.Team", b => + { + b.HasOne("EntityFrameworkCore.Domain.Coach", "Coach") + .WithOne("Team") + .HasForeignKey("EntityFrameworkCore.Domain.Team", "CoachId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("EntityFrameworkCore.Domain.League", "League") + .WithMany("Teams") + .HasForeignKey("LeagueId"); + + b.Navigation("Coach"); + + b.Navigation("League"); + }); + + modelBuilder.Entity("EntityFrameworkCore.Domain.Coach", b => + { + b.Navigation("Team"); + }); + + modelBuilder.Entity("EntityFrameworkCore.Domain.League", b => + { + b.Navigation("Teams"); + }); + + modelBuilder.Entity("EntityFrameworkCore.Domain.Team", b => + { + b.Navigation("AwayMatches"); + + b.Navigation("HomeMatches"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/EntityFrameworkCore.Data/Migrations/20250414200332_AddConcurrencyCheckVersionToken.cs b/EntityFrameworkCore.Data/Migrations/20250414200332_AddConcurrencyCheckVersionToken.cs new file mode 100644 index 0000000..ee8df7f --- /dev/null +++ b/EntityFrameworkCore.Data/Migrations/20250414200332_AddConcurrencyCheckVersionToken.cs @@ -0,0 +1,301 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EntityFrameworkCore.Data.Migrations +{ + /// + public partial class AddConcurrencyCheckVersionToken : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Version", + table: "Teams", + type: "TEXT", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.AddColumn( + name: "Version", + table: "Matches", + type: "TEXT", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.AddColumn( + name: "Version", + table: "Leagues", + type: "TEXT", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.AddColumn( + name: "Version", + table: "Coaches", + type: "TEXT", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Coaches", + keyColumn: "Id", + keyValue: 1, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Coaches", + keyColumn: "Id", + keyValue: 2, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Coaches", + keyColumn: "Id", + keyValue: 3, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Coaches", + keyColumn: "Id", + keyValue: 4, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Coaches", + keyColumn: "Id", + keyValue: 5, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Coaches", + keyColumn: "Id", + keyValue: 6, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Coaches", + keyColumn: "Id", + keyValue: 7, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Coaches", + keyColumn: "Id", + keyValue: 8, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Coaches", + keyColumn: "Id", + keyValue: 9, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Coaches", + keyColumn: "Id", + keyValue: 10, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Coaches", + keyColumn: "Id", + keyValue: 11, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Coaches", + keyColumn: "Id", + keyValue: 12, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Coaches", + keyColumn: "Id", + keyValue: 13, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Coaches", + keyColumn: "Id", + keyValue: 14, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Coaches", + keyColumn: "Id", + keyValue: 15, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Leagues", + keyColumn: "Id", + keyValue: 1, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Leagues", + keyColumn: "Id", + keyValue: 2, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Leagues", + keyColumn: "Id", + keyValue: 3, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Leagues", + keyColumn: "Id", + keyValue: 4, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Teams", + keyColumn: "Id", + keyValue: 1, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Teams", + keyColumn: "Id", + keyValue: 2, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Teams", + keyColumn: "Id", + keyValue: 3, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Teams", + keyColumn: "Id", + keyValue: 4, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Teams", + keyColumn: "Id", + keyValue: 5, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Teams", + keyColumn: "Id", + keyValue: 6, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Teams", + keyColumn: "Id", + keyValue: 7, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Teams", + keyColumn: "Id", + keyValue: 8, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Teams", + keyColumn: "Id", + keyValue: 9, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Teams", + keyColumn: "Id", + keyValue: 10, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Teams", + keyColumn: "Id", + keyValue: 11, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Teams", + keyColumn: "Id", + keyValue: 12, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Teams", + keyColumn: "Id", + keyValue: 13, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Teams", + keyColumn: "Id", + keyValue: 14, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.UpdateData( + table: "Teams", + keyColumn: "Id", + keyValue: 15, + column: "Version", + value: new Guid("00000000-0000-0000-0000-000000000000")); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Version", + table: "Teams"); + + migrationBuilder.DropColumn( + name: "Version", + table: "Matches"); + + migrationBuilder.DropColumn( + name: "Version", + table: "Leagues"); + + migrationBuilder.DropColumn( + name: "Version", + table: "Coaches"); + } + } +} diff --git a/EntityFrameworkCore.Data/Migrations/DeadBallZoneLeagueDbContextModelSnapshot.cs b/EntityFrameworkCore.Data/Migrations/DeadBallZoneLeagueDbContextModelSnapshot.cs index c7135e5..f6c4aeb 100644 --- a/EntityFrameworkCore.Data/Migrations/DeadBallZoneLeagueDbContextModelSnapshot.cs +++ b/EntityFrameworkCore.Data/Migrations/DeadBallZoneLeagueDbContextModelSnapshot.cs @@ -24,12 +24,14 @@ namespace EntityFrameworkCore.Data.Migrations .HasColumnType("INTEGER"); b.Property("CreatedBy") + .HasMaxLength(100) .HasColumnType("TEXT"); b.Property("CreatedDate") .HasColumnType("TEXT"); b.Property("ModifiedBy") + .HasMaxLength(100) .HasColumnType("TEXT"); b.Property("ModifiedDate") @@ -40,6 +42,10 @@ namespace EntityFrameworkCore.Data.Migrations .HasMaxLength(100) .HasColumnType("TEXT"); + b.Property("Version") + .IsConcurrencyToken() + .HasColumnType("TEXT"); + b.HasKey("Id"); b.ToTable("Coaches"); @@ -50,105 +56,120 @@ namespace EntityFrameworkCore.Data.Migrations Id = 1, CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Christian Southgate" + Name = "Christian Southgate", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 2, CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Rob Mann" + Name = "Rob Mann", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 3, CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Jon Curtis" + Name = "Jon Curtis", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 4, CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Andy Taylor" + Name = "Andy Taylor", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 5, CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Steve Johnson" + Name = "Steve Johnson", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 6, CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Dan Cook" + Name = "Dan Cook", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 7, CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Ken Jarvis" + Name = "Ken Jarvis", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 8, CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Kenny Suzuki" + Name = "Kenny Suzuki", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 9, CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Gordon Hall" + Name = "Gordon Hall", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 10, CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "John O Dowd" + Name = "John O Dowd", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 11, CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Julian Widdows" + Name = "Julian Widdows", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 12, CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Andy Williams" + Name = "Andy Williams", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 13, CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Trevor Williams" + Name = "Trevor Williams", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 14, CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Blake Deathray" + Name = "Blake Deathray", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 15, CreatedDate = new DateTime(2025, 4, 7, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Rock Housebrick" + Name = "Rock Housebrick", + Version = new Guid("00000000-0000-0000-0000-000000000000") }); }); @@ -159,18 +180,25 @@ namespace EntityFrameworkCore.Data.Migrations .HasColumnType("INTEGER"); b.Property("CreatedBy") + .HasMaxLength(100) .HasColumnType("TEXT"); b.Property("CreatedDate") .HasColumnType("TEXT"); b.Property("ModifiedBy") + .HasMaxLength(100) .HasColumnType("TEXT"); b.Property("ModifiedDate") .HasColumnType("TEXT"); b.Property("Name") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Version") + .IsConcurrencyToken() .HasColumnType("TEXT"); b.HasKey("Id"); @@ -183,28 +211,32 @@ namespace EntityFrameworkCore.Data.Migrations Id = 1, CreatedDate = new DateTime(2025, 4, 6, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Local League" + Name = "Local League", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 2, CreatedDate = new DateTime(2025, 4, 6, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "National League" + Name = "National League", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 3, CreatedDate = new DateTime(2025, 4, 6, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Geosphere" + Name = "Geosphere", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { Id = 4, CreatedDate = new DateTime(2025, 4, 6, 17, 7, 27, 33, DateTimeKind.Unspecified), ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Cyber war" + Name = "Cyber war", + Version = new Guid("00000000-0000-0000-0000-000000000000") }); }); @@ -221,6 +253,7 @@ namespace EntityFrameworkCore.Data.Migrations .HasColumnType("INTEGER"); b.Property("CreatedBy") + .HasMaxLength(100) .HasColumnType("TEXT"); b.Property("CreatedDate") @@ -236,12 +269,18 @@ namespace EntityFrameworkCore.Data.Migrations .HasColumnType("INTEGER"); b.Property("ModifiedBy") + .HasMaxLength(100) .HasColumnType("TEXT"); b.Property("ModifiedDate") .HasColumnType("TEXT"); b.Property("TicketPrice") + .HasPrecision(16, 2) + .HasColumnType("TEXT"); + + b.Property("Version") + .IsConcurrencyToken() .HasColumnType("TEXT"); b.HasKey("Id"); @@ -263,6 +302,7 @@ namespace EntityFrameworkCore.Data.Migrations .HasColumnType("INTEGER"); b.Property("CreatedBy") + .HasMaxLength(100) .HasColumnType("TEXT"); b.Property("CreatedDate") @@ -272,6 +312,7 @@ namespace EntityFrameworkCore.Data.Migrations .HasColumnType("INTEGER"); b.Property("ModifiedBy") + .HasMaxLength(100) .HasColumnType("TEXT"); b.Property("ModifiedDate") @@ -282,6 +323,10 @@ namespace EntityFrameworkCore.Data.Migrations .HasMaxLength(100) .HasColumnType("TEXT"); + b.Property("Version") + .IsConcurrencyToken() + .HasColumnType("TEXT"); + b.HasKey("Id"); b.HasIndex("CoachId") @@ -302,7 +347,8 @@ namespace EntityFrameworkCore.Data.Migrations CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), LeagueId = 2, ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Neo Delhi" + Name = "Neo Delhi", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { @@ -311,7 +357,8 @@ namespace EntityFrameworkCore.Data.Migrations CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), LeagueId = 1, ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Voodoo" + Name = "Voodoo", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { @@ -320,7 +367,8 @@ namespace EntityFrameworkCore.Data.Migrations CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), LeagueId = 1, ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Penal X" + Name = "Penal X", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { @@ -329,7 +377,8 @@ namespace EntityFrameworkCore.Data.Migrations CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), LeagueId = 3, ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Neo Tokyo" + Name = "Neo Tokyo", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { @@ -338,7 +387,8 @@ namespace EntityFrameworkCore.Data.Migrations CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), LeagueId = 2, ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Neo Barcelona" + Name = "Neo Barcelona", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { @@ -347,7 +397,8 @@ namespace EntityFrameworkCore.Data.Migrations CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), LeagueId = 2, ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Neo Manchester" + Name = "Neo Manchester", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { @@ -356,7 +407,8 @@ namespace EntityFrameworkCore.Data.Migrations CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), LeagueId = 3, ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Neo Bangkok" + Name = "Neo Bangkok", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { @@ -365,7 +417,8 @@ namespace EntityFrameworkCore.Data.Migrations CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), LeagueId = 3, ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Neo Amsterdam" + Name = "Neo Amsterdam", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { @@ -374,7 +427,8 @@ namespace EntityFrameworkCore.Data.Migrations CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), LeagueId = 1, ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Killaklowns" + Name = "Killaklowns", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { @@ -383,7 +437,8 @@ namespace EntityFrameworkCore.Data.Migrations CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), LeagueId = 1, ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Sol" + Name = "Sol", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { @@ -392,7 +447,8 @@ namespace EntityFrameworkCore.Data.Migrations CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), LeagueId = 4, ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "DEC" + Name = "DEC", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { @@ -401,7 +457,8 @@ namespace EntityFrameworkCore.Data.Migrations CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), LeagueId = 1, ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Leopards" + Name = "Leopards", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { @@ -410,7 +467,8 @@ namespace EntityFrameworkCore.Data.Migrations CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), LeagueId = 1, ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Harlequins" + Name = "Harlequins", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { @@ -419,7 +477,8 @@ namespace EntityFrameworkCore.Data.Migrations CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), LeagueId = 4, ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Gladiators" + Name = "Gladiators", + Version = new Guid("00000000-0000-0000-0000-000000000000") }, new { @@ -428,16 +487,19 @@ namespace EntityFrameworkCore.Data.Migrations CreatedDate = new DateTime(2025, 4, 4, 17, 7, 27, 33, DateTimeKind.Unspecified), LeagueId = 1, ModifiedDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - Name = "Fiz-O" + Name = "Fiz-O", + Version = new Guid("00000000-0000-0000-0000-000000000000") }); }); modelBuilder.Entity("EntityFrameworkCore.Domain.TeamsAndLeaguesView", b => { b.Property("LeagueName") + .HasMaxLength(100) .HasColumnType("TEXT"); b.Property("Name") + .HasMaxLength(100) .HasColumnType("TEXT"); b.ToTable((string)null);