From 899b2a2f79cd04751d5483dfd17e41782865510b Mon Sep 17 00:00:00 2001 From: Maxence Lanone Date: Wed, 8 Mar 2023 13:04:43 +0100 Subject: [PATCH] :fire: rm SQLiteContext and replace by LolContext --- ...gner.cs => 20230308120111_MyMigration.Designer.cs} | 11 +++++++---- ...8_MyMigration.cs => 20230308120111_MyMigration.cs} | 7 ++++--- .../Migrations/LolContextModelSnapshot.cs | 9 ++++++--- Sources/WebApiLol/WebApiLol.csproj | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) rename Sources/EntityFrameWorkLib/Migrations/{20230201072518_MyMigration.Designer.cs => 20230308120111_MyMigration.Designer.cs} (80%) rename Sources/EntityFrameWorkLib/Migrations/{20230201072518_MyMigration.cs => 20230308120111_MyMigration.cs} (79%) diff --git a/Sources/EntityFrameWorkLib/Migrations/20230201072518_MyMigration.Designer.cs b/Sources/EntityFrameWorkLib/Migrations/20230308120111_MyMigration.Designer.cs similarity index 80% rename from Sources/EntityFrameWorkLib/Migrations/20230201072518_MyMigration.Designer.cs rename to Sources/EntityFrameWorkLib/Migrations/20230308120111_MyMigration.Designer.cs index a18c0bf..7be9ec3 100644 --- a/Sources/EntityFrameWorkLib/Migrations/20230201072518_MyMigration.Designer.cs +++ b/Sources/EntityFrameWorkLib/Migrations/20230308120111_MyMigration.Designer.cs @@ -10,18 +10,18 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace EntityFrameWorkLib.Migrations { [DbContext(typeof(LolContext))] - [Migration("20230201072518_MyMigration")] + [Migration("20230308120111_MyMigration")] partial class MyMigration { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.2"); + modelBuilder.HasAnnotation("ProductVersion", "7.0.3"); modelBuilder.Entity("EntityFrameWorkLib.ChampionEntity", b => { - b.Property("Id") + b.Property("UniqueId") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); @@ -37,7 +37,10 @@ namespace EntityFrameWorkLib.Migrations .IsRequired() .HasColumnType("TEXT"); - b.HasKey("Id"); + b.Property("championClass") + .HasColumnType("INTEGER"); + + b.HasKey("UniqueId"); b.ToTable("Champions"); }); diff --git a/Sources/EntityFrameWorkLib/Migrations/20230201072518_MyMigration.cs b/Sources/EntityFrameWorkLib/Migrations/20230308120111_MyMigration.cs similarity index 79% rename from Sources/EntityFrameWorkLib/Migrations/20230201072518_MyMigration.cs rename to Sources/EntityFrameWorkLib/Migrations/20230308120111_MyMigration.cs index 5c11b22..f82da3b 100644 --- a/Sources/EntityFrameWorkLib/Migrations/20230201072518_MyMigration.cs +++ b/Sources/EntityFrameWorkLib/Migrations/20230308120111_MyMigration.cs @@ -14,15 +14,16 @@ namespace EntityFrameWorkLib.Migrations name: "Champions", columns: table => new { - Id = table.Column(type: "INTEGER", nullable: false) + UniqueId = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Name = table.Column(type: "TEXT", nullable: false), Bio = table.Column(type: "TEXT", nullable: false), - Icon = table.Column(type: "TEXT", nullable: false) + Icon = table.Column(type: "TEXT", nullable: false), + championClass = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { - table.PrimaryKey("PK_Champions", x => x.Id); + table.PrimaryKey("PK_Champions", x => x.UniqueId); }); } diff --git a/Sources/EntityFrameWorkLib/Migrations/LolContextModelSnapshot.cs b/Sources/EntityFrameWorkLib/Migrations/LolContextModelSnapshot.cs index 3e85134..86cbf85 100644 --- a/Sources/EntityFrameWorkLib/Migrations/LolContextModelSnapshot.cs +++ b/Sources/EntityFrameWorkLib/Migrations/LolContextModelSnapshot.cs @@ -14,11 +14,11 @@ namespace EntityFrameWorkLib.Migrations protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.2"); + modelBuilder.HasAnnotation("ProductVersion", "7.0.3"); modelBuilder.Entity("EntityFrameWorkLib.ChampionEntity", b => { - b.Property("Id") + b.Property("UniqueId") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); @@ -34,7 +34,10 @@ namespace EntityFrameWorkLib.Migrations .IsRequired() .HasColumnType("TEXT"); - b.HasKey("Id"); + b.Property("championClass") + .HasColumnType("INTEGER"); + + b.HasKey("UniqueId"); b.ToTable("Champions"); }); diff --git a/Sources/WebApiLol/WebApiLol.csproj b/Sources/WebApiLol/WebApiLol.csproj index 53eb00f..12d51ee 100644 --- a/Sources/WebApiLol/WebApiLol.csproj +++ b/Sources/WebApiLol/WebApiLol.csproj @@ -11,7 +11,7 @@ - +