From 61d51bc45dcd0ade558825c09ca2832f74fce2d3 Mon Sep 17 00:00:00 2001 From: Jolys Enzo Date: Wed, 22 Feb 2023 15:22:33 +0100 Subject: [PATCH] avancement --- Sources/EntityFramwork/BDD-APILOL.db | Bin 53248 -> 94208 bytes Sources/EntityFramwork/BDD-APILOL.db-shm | Bin 32768 -> 0 bytes Sources/EntityFramwork/BDD-APILOL.db-wal | 0 Sources/EntityFramwork/BDDContext.cs | 39 +- Sources/EntityFramwork/EntityCategorieRune.cs | 23 + Sources/EntityFramwork/EntityPageRune.cs | 19 + Sources/EntityFramwork/EntityRunes.cs | 4 + .../20230222130004_final.Designer.cs | 309 ++++++++++++ .../Migrations/20230222130004_final.cs | 170 +++++++ .../20230222130958_final2.Designer.cs | 309 ++++++++++++ .../Migrations/20230222130958_final2.cs | 22 + .../20230222141822_testModel.Designer.cs | 456 ++++++++++++++++++ .../Migrations/20230222141822_testModel.cs | 321 ++++++++++++ .../Migrations/BDDContextModelSnapshot.cs | 271 ++++++++++- 14 files changed, 1939 insertions(+), 4 deletions(-) delete mode 100644 Sources/EntityFramwork/BDD-APILOL.db-shm delete mode 100644 Sources/EntityFramwork/BDD-APILOL.db-wal create mode 100644 Sources/EntityFramwork/EntityCategorieRune.cs create mode 100644 Sources/EntityFramwork/EntityPageRune.cs create mode 100644 Sources/EntityFramwork/Migrations/20230222130004_final.Designer.cs create mode 100644 Sources/EntityFramwork/Migrations/20230222130004_final.cs create mode 100644 Sources/EntityFramwork/Migrations/20230222130958_final2.Designer.cs create mode 100644 Sources/EntityFramwork/Migrations/20230222130958_final2.cs create mode 100644 Sources/EntityFramwork/Migrations/20230222141822_testModel.Designer.cs create mode 100644 Sources/EntityFramwork/Migrations/20230222141822_testModel.cs diff --git a/Sources/EntityFramwork/BDD-APILOL.db b/Sources/EntityFramwork/BDD-APILOL.db index a7df7d88ec13291d524c739d2dcde8617f58ee63..1627c5b65a09d04b1f7ad3707c545980146f3e87 100644 GIT binary patch literal 94208 zcmeI4O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.WithOne(e => e.Rune) + .HasForeignKey(e => e.IdRune); // -------------------------------------------------------------------------------// //création de la table Skills modelBuilder.Entity().HasKey(c => c.Id); modelBuilder.Entity().Property(c => c.Id) .ValueGeneratedOnAdd(); + + // -------------------------------------------------------------------------------// + //création de la table Page rune + modelBuilder.Entity().HasKey(c => c.Id); + modelBuilder.Entity().Property(c => c.Id) + .ValueGeneratedOnAdd(); + + modelBuilder.Entity().HasMany(e => e.CategorieRune) + .WithOne(e => e.PageRune) + .HasForeignKey(e => e.IdPageRune); + + // -------------------------------------------------------------------------------// + //création de la table Categorie_Rune + modelBuilder.Entity().HasKey(c => c.Id); + modelBuilder.Entity().Property(c => c.Id) + .ValueGeneratedOnAdd(); + + // ---------------------------------- Stub --------------------------------------// + // Ajout Image + + int nbImage = 29; + List listImage = new List(); + for( int i=1; i().HasData(listImage); + // Ajout Champion + + } public DbSet Champions { get; set; } @@ -74,12 +109,14 @@ namespace EntityFramwork public DbSet Images { get; set; } public DbSet Runes { get; set; } public DbSet Skills { get; set; } + public DbSet PageRunes { get; set; } + public DbSet CategorieRunes { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if (!optionsBuilder.IsConfigured) { - optionsBuilder.UseSqlite($"Data Source=C:\\Users\\Jolys Enzo\\home\\BUT\\Projet\\LOL-API\\Sources\\EntityFramwork\\BDD-APILOL.db"); + optionsBuilder.UseSqlite($"Data Source=BDD-APILOL.db"); } } } diff --git a/Sources/EntityFramwork/EntityCategorieRune.cs b/Sources/EntityFramwork/EntityCategorieRune.cs new file mode 100644 index 0000000..da05d16 --- /dev/null +++ b/Sources/EntityFramwork/EntityCategorieRune.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EntityFramwork +{ + public class EntityCategorieRune + { + public int Id { get; set; } + + public string Category { get; set; } + + // Relation Page rune + public int IdPageRune { get; set;} + public EntityPageRune PageRune { get; set; } + + // Relation Rune + public int IdRune { get; set;} + public EntityRunes Rune { get; set; } + } +} diff --git a/Sources/EntityFramwork/EntityPageRune.cs b/Sources/EntityFramwork/EntityPageRune.cs new file mode 100644 index 0000000..be9bbd6 --- /dev/null +++ b/Sources/EntityFramwork/EntityPageRune.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EntityFramwork +{ + public class EntityPageRune + { + public int Id { get; set; } + + public string Name { get; set; } + + // Relation + public List CategorieRune { get; set; + } + } +} diff --git a/Sources/EntityFramwork/EntityRunes.cs b/Sources/EntityFramwork/EntityRunes.cs index 12a9633..4b59181 100644 --- a/Sources/EntityFramwork/EntityRunes.cs +++ b/Sources/EntityFramwork/EntityRunes.cs @@ -18,5 +18,9 @@ namespace EntityFramwork // --------- Images ---------- // public int ImageId { get; set; } public EntityLargeImage Image { get; set; } + + // -------- CategorieRune --------// + + public List CategorieRune { get; set; } } } diff --git a/Sources/EntityFramwork/Migrations/20230222130004_final.Designer.cs b/Sources/EntityFramwork/Migrations/20230222130004_final.Designer.cs new file mode 100644 index 0000000..afdfaaf --- /dev/null +++ b/Sources/EntityFramwork/Migrations/20230222130004_final.Designer.cs @@ -0,0 +1,309 @@ +// +using EntityFramwork; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace EntityFramwork.Migrations +{ + [DbContext(typeof(BDDContext))] + [Migration("20230222130004_final")] + partial class final + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "7.0.2"); + + modelBuilder.Entity("DTO.EntityChampions", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Bio") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Classe") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ImageId") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Champions"); + }); + + modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Category") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("IdPageRune") + .HasColumnType("INTEGER"); + + b.Property("IdRune") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("IdPageRune"); + + b.HasIndex("IdRune"); + + b.ToTable("EntityCategorieRune"); + }); + + modelBuilder.Entity("EntityFramwork.EntityLargeImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Base64") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Images"); + }); + + modelBuilder.Entity("EntityFramwork.EntityPageRune", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("EntityPageRune"); + }); + + modelBuilder.Entity("EntityFramwork.EntityRunes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Family") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ImageId") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.ToTable("Runes"); + }); + + modelBuilder.Entity("EntityFramwork.EntitySkill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ChampionId") + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Type") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ChampionId"); + + b.ToTable("Skills"); + }); + + modelBuilder.Entity("EntityFramwork.EntitySkins", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ChampionId") + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ImageId") + .HasColumnType("INTEGER"); + + b.Property("Price") + .HasColumnType("REAL"); + + b.HasKey("Id"); + + b.HasIndex("ChampionId"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.ToTable("Skins"); + }); + + modelBuilder.Entity("DTO.EntityChampions", b => + { + b.HasOne("EntityFramwork.EntityLargeImage", "Image") + .WithOne("Champion") + .HasForeignKey("DTO.EntityChampions", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b => + { + b.HasOne("EntityFramwork.EntityPageRune", "PageRune") + .WithMany("CategorieRune") + .HasForeignKey("IdPageRune") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("EntityFramwork.EntityRunes", "Rune") + .WithMany("CategorieRune") + .HasForeignKey("IdRune") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PageRune"); + + b.Navigation("Rune"); + }); + + modelBuilder.Entity("EntityFramwork.EntityRunes", b => + { + b.HasOne("EntityFramwork.EntityLargeImage", "Image") + .WithOne("Rune") + .HasForeignKey("EntityFramwork.EntityRunes", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("EntityFramwork.EntitySkill", b => + { + b.HasOne("DTO.EntityChampions", "Champions") + .WithMany("Skills") + .HasForeignKey("ChampionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Champions"); + }); + + modelBuilder.Entity("EntityFramwork.EntitySkins", b => + { + b.HasOne("DTO.EntityChampions", "Champion") + .WithMany("Skins") + .HasForeignKey("ChampionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("EntityFramwork.EntityLargeImage", "Image") + .WithOne("Skin") + .HasForeignKey("EntityFramwork.EntitySkins", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Champion"); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("DTO.EntityChampions", b => + { + b.Navigation("Skills"); + + b.Navigation("Skins"); + }); + + modelBuilder.Entity("EntityFramwork.EntityLargeImage", b => + { + b.Navigation("Champion") + .IsRequired(); + + b.Navigation("Rune") + .IsRequired(); + + b.Navigation("Skin") + .IsRequired(); + }); + + modelBuilder.Entity("EntityFramwork.EntityPageRune", b => + { + b.Navigation("CategorieRune"); + }); + + modelBuilder.Entity("EntityFramwork.EntityRunes", b => + { + b.Navigation("CategorieRune"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Sources/EntityFramwork/Migrations/20230222130004_final.cs b/Sources/EntityFramwork/Migrations/20230222130004_final.cs new file mode 100644 index 0000000..2f14d1f --- /dev/null +++ b/Sources/EntityFramwork/Migrations/20230222130004_final.cs @@ -0,0 +1,170 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EntityFramwork.Migrations +{ + /// + public partial class final : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Skins_Champions_ChampionForeignKey", + table: "Skins"); + + migrationBuilder.RenameColumn( + name: "ChampionForeignKey", + table: "Skins", + newName: "ChampionId"); + + migrationBuilder.RenameIndex( + name: "IX_Skins_ChampionForeignKey", + table: "Skins", + newName: "IX_Skins_ChampionId"); + + migrationBuilder.AddColumn( + name: "Family", + table: "Runes", + type: "TEXT", + nullable: false, + defaultValue: ""); + + migrationBuilder.AddColumn( + name: "Classe", + table: "Champions", + type: "TEXT", + nullable: false, + defaultValue: ""); + + migrationBuilder.CreateTable( + name: "EntityPageRune", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Name = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_EntityPageRune", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Skills", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Name = table.Column(type: "TEXT", nullable: false), + Description = table.Column(type: "TEXT", nullable: false), + Type = table.Column(type: "TEXT", nullable: false), + ChampionId = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Skills", x => x.Id); + table.ForeignKey( + name: "FK_Skills_Champions_ChampionId", + column: x => x.ChampionId, + principalTable: "Champions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "EntityCategorieRune", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Category = table.Column(type: "TEXT", nullable: false), + IdPageRune = table.Column(type: "INTEGER", nullable: false), + IdRune = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_EntityCategorieRune", x => x.Id); + table.ForeignKey( + name: "FK_EntityCategorieRune_EntityPageRune_IdPageRune", + column: x => x.IdPageRune, + principalTable: "EntityPageRune", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_EntityCategorieRune_Runes_IdRune", + column: x => x.IdRune, + principalTable: "Runes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_EntityCategorieRune_IdPageRune", + table: "EntityCategorieRune", + column: "IdPageRune"); + + migrationBuilder.CreateIndex( + name: "IX_EntityCategorieRune_IdRune", + table: "EntityCategorieRune", + column: "IdRune"); + + migrationBuilder.CreateIndex( + name: "IX_Skills_ChampionId", + table: "Skills", + column: "ChampionId"); + + migrationBuilder.AddForeignKey( + name: "FK_Skins_Champions_ChampionId", + table: "Skins", + column: "ChampionId", + principalTable: "Champions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Skins_Champions_ChampionId", + table: "Skins"); + + migrationBuilder.DropTable( + name: "EntityCategorieRune"); + + migrationBuilder.DropTable( + name: "Skills"); + + migrationBuilder.DropTable( + name: "EntityPageRune"); + + migrationBuilder.DropColumn( + name: "Family", + table: "Runes"); + + migrationBuilder.DropColumn( + name: "Classe", + table: "Champions"); + + migrationBuilder.RenameColumn( + name: "ChampionId", + table: "Skins", + newName: "ChampionForeignKey"); + + migrationBuilder.RenameIndex( + name: "IX_Skins_ChampionId", + table: "Skins", + newName: "IX_Skins_ChampionForeignKey"); + + migrationBuilder.AddForeignKey( + name: "FK_Skins_Champions_ChampionForeignKey", + table: "Skins", + column: "ChampionForeignKey", + principalTable: "Champions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + } +} diff --git a/Sources/EntityFramwork/Migrations/20230222130958_final2.Designer.cs b/Sources/EntityFramwork/Migrations/20230222130958_final2.Designer.cs new file mode 100644 index 0000000..5720939 --- /dev/null +++ b/Sources/EntityFramwork/Migrations/20230222130958_final2.Designer.cs @@ -0,0 +1,309 @@ +// +using EntityFramwork; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace EntityFramwork.Migrations +{ + [DbContext(typeof(BDDContext))] + [Migration("20230222130958_final2")] + partial class final2 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "7.0.2"); + + modelBuilder.Entity("DTO.EntityChampions", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Bio") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Classe") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ImageId") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Champions"); + }); + + modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Category") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("IdPageRune") + .HasColumnType("INTEGER"); + + b.Property("IdRune") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("IdPageRune"); + + b.HasIndex("IdRune"); + + b.ToTable("EntityCategorieRune"); + }); + + modelBuilder.Entity("EntityFramwork.EntityLargeImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Base64") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Images"); + }); + + modelBuilder.Entity("EntityFramwork.EntityPageRune", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("EntityPageRune"); + }); + + modelBuilder.Entity("EntityFramwork.EntityRunes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Family") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ImageId") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.ToTable("Runes"); + }); + + modelBuilder.Entity("EntityFramwork.EntitySkill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ChampionId") + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Type") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ChampionId"); + + b.ToTable("Skills"); + }); + + modelBuilder.Entity("EntityFramwork.EntitySkins", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ChampionId") + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ImageId") + .HasColumnType("INTEGER"); + + b.Property("Price") + .HasColumnType("REAL"); + + b.HasKey("Id"); + + b.HasIndex("ChampionId"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.ToTable("Skins"); + }); + + modelBuilder.Entity("DTO.EntityChampions", b => + { + b.HasOne("EntityFramwork.EntityLargeImage", "Image") + .WithOne("Champion") + .HasForeignKey("DTO.EntityChampions", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b => + { + b.HasOne("EntityFramwork.EntityPageRune", "PageRune") + .WithMany("CategorieRune") + .HasForeignKey("IdPageRune") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("EntityFramwork.EntityRunes", "Rune") + .WithMany("CategorieRune") + .HasForeignKey("IdRune") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PageRune"); + + b.Navigation("Rune"); + }); + + modelBuilder.Entity("EntityFramwork.EntityRunes", b => + { + b.HasOne("EntityFramwork.EntityLargeImage", "Image") + .WithOne("Rune") + .HasForeignKey("EntityFramwork.EntityRunes", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("EntityFramwork.EntitySkill", b => + { + b.HasOne("DTO.EntityChampions", "Champions") + .WithMany("Skills") + .HasForeignKey("ChampionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Champions"); + }); + + modelBuilder.Entity("EntityFramwork.EntitySkins", b => + { + b.HasOne("DTO.EntityChampions", "Champion") + .WithMany("Skins") + .HasForeignKey("ChampionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("EntityFramwork.EntityLargeImage", "Image") + .WithOne("Skin") + .HasForeignKey("EntityFramwork.EntitySkins", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Champion"); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("DTO.EntityChampions", b => + { + b.Navigation("Skills"); + + b.Navigation("Skins"); + }); + + modelBuilder.Entity("EntityFramwork.EntityLargeImage", b => + { + b.Navigation("Champion") + .IsRequired(); + + b.Navigation("Rune") + .IsRequired(); + + b.Navigation("Skin") + .IsRequired(); + }); + + modelBuilder.Entity("EntityFramwork.EntityPageRune", b => + { + b.Navigation("CategorieRune"); + }); + + modelBuilder.Entity("EntityFramwork.EntityRunes", b => + { + b.Navigation("CategorieRune"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Sources/EntityFramwork/Migrations/20230222130958_final2.cs b/Sources/EntityFramwork/Migrations/20230222130958_final2.cs new file mode 100644 index 0000000..692008a --- /dev/null +++ b/Sources/EntityFramwork/Migrations/20230222130958_final2.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EntityFramwork.Migrations +{ + /// + public partial class final2 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/Sources/EntityFramwork/Migrations/20230222141822_testModel.Designer.cs b/Sources/EntityFramwork/Migrations/20230222141822_testModel.Designer.cs new file mode 100644 index 0000000..a73e590 --- /dev/null +++ b/Sources/EntityFramwork/Migrations/20230222141822_testModel.Designer.cs @@ -0,0 +1,456 @@ +// +using EntityFramwork; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace EntityFramwork.Migrations +{ + [DbContext(typeof(BDDContext))] + [Migration("20230222141822_testModel")] + partial class testModel + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "7.0.2"); + + modelBuilder.Entity("DTO.EntityChampions", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Bio") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Classe") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ImageId") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Champions"); + }); + + modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Category") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("IdPageRune") + .HasColumnType("INTEGER"); + + b.Property("IdRune") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("IdPageRune"); + + b.HasIndex("IdRune"); + + b.ToTable("CategorieRunes"); + }); + + modelBuilder.Entity("EntityFramwork.EntityLargeImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Base64") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Images"); + + b.HasData( + new + { + Id = 1, + Base64 = "Inconnu !" + }, + new + { + Id = 2, + Base64 = "Inconnu !" + }, + new + { + Id = 3, + Base64 = "Inconnu !" + }, + new + { + Id = 4, + Base64 = "Inconnu !" + }, + new + { + Id = 5, + Base64 = "Inconnu !" + }, + new + { + Id = 6, + Base64 = "Inconnu !" + }, + new + { + Id = 7, + Base64 = "Inconnu !" + }, + new + { + Id = 8, + Base64 = "Inconnu !" + }, + new + { + Id = 9, + Base64 = "Inconnu !" + }, + new + { + Id = 10, + Base64 = "Inconnu !" + }, + new + { + Id = 11, + Base64 = "Inconnu !" + }, + new + { + Id = 12, + Base64 = "Inconnu !" + }, + new + { + Id = 13, + Base64 = "Inconnu !" + }, + new + { + Id = 14, + Base64 = "Inconnu !" + }, + new + { + Id = 15, + Base64 = "Inconnu !" + }, + new + { + Id = 16, + Base64 = "Inconnu !" + }, + new + { + Id = 17, + Base64 = "Inconnu !" + }, + new + { + Id = 18, + Base64 = "Inconnu !" + }, + new + { + Id = 19, + Base64 = "Inconnu !" + }, + new + { + Id = 20, + Base64 = "Inconnu !" + }, + new + { + Id = 21, + Base64 = "Inconnu !" + }, + new + { + Id = 22, + Base64 = "Inconnu !" + }, + new + { + Id = 23, + Base64 = "Inconnu !" + }, + new + { + Id = 24, + Base64 = "Inconnu !" + }, + new + { + Id = 25, + Base64 = "Inconnu !" + }, + new + { + Id = 26, + Base64 = "Inconnu !" + }, + new + { + Id = 27, + Base64 = "Inconnu !" + }, + new + { + Id = 28, + Base64 = "Inconnu !" + }, + new + { + Id = 29, + Base64 = "Inconnu !" + }); + }); + + modelBuilder.Entity("EntityFramwork.EntityPageRune", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("PageRunes"); + }); + + modelBuilder.Entity("EntityFramwork.EntityRunes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Family") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ImageId") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.ToTable("Runes"); + }); + + modelBuilder.Entity("EntityFramwork.EntitySkill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ChampionId") + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Type") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ChampionId"); + + b.ToTable("Skills"); + }); + + modelBuilder.Entity("EntityFramwork.EntitySkins", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ChampionId") + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Icon") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ImageId") + .HasColumnType("INTEGER"); + + b.Property("Price") + .HasColumnType("REAL"); + + b.HasKey("Id"); + + b.HasIndex("ChampionId"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.ToTable("Skins"); + }); + + modelBuilder.Entity("DTO.EntityChampions", b => + { + b.HasOne("EntityFramwork.EntityLargeImage", "Image") + .WithOne("Champion") + .HasForeignKey("DTO.EntityChampions", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b => + { + b.HasOne("EntityFramwork.EntityPageRune", "PageRune") + .WithMany("CategorieRune") + .HasForeignKey("IdPageRune") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("EntityFramwork.EntityRunes", "Rune") + .WithMany("CategorieRune") + .HasForeignKey("IdRune") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PageRune"); + + b.Navigation("Rune"); + }); + + modelBuilder.Entity("EntityFramwork.EntityRunes", b => + { + b.HasOne("EntityFramwork.EntityLargeImage", "Image") + .WithOne("Rune") + .HasForeignKey("EntityFramwork.EntityRunes", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("EntityFramwork.EntitySkill", b => + { + b.HasOne("DTO.EntityChampions", "Champions") + .WithMany("Skills") + .HasForeignKey("ChampionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Champions"); + }); + + modelBuilder.Entity("EntityFramwork.EntitySkins", b => + { + b.HasOne("DTO.EntityChampions", "Champion") + .WithMany("Skins") + .HasForeignKey("ChampionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("EntityFramwork.EntityLargeImage", "Image") + .WithOne("Skin") + .HasForeignKey("EntityFramwork.EntitySkins", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Champion"); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("DTO.EntityChampions", b => + { + b.Navigation("Skills"); + + b.Navigation("Skins"); + }); + + modelBuilder.Entity("EntityFramwork.EntityLargeImage", b => + { + b.Navigation("Champion") + .IsRequired(); + + b.Navigation("Rune") + .IsRequired(); + + b.Navigation("Skin") + .IsRequired(); + }); + + modelBuilder.Entity("EntityFramwork.EntityPageRune", b => + { + b.Navigation("CategorieRune"); + }); + + modelBuilder.Entity("EntityFramwork.EntityRunes", b => + { + b.Navigation("CategorieRune"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Sources/EntityFramwork/Migrations/20230222141822_testModel.cs b/Sources/EntityFramwork/Migrations/20230222141822_testModel.cs new file mode 100644 index 0000000..462c049 --- /dev/null +++ b/Sources/EntityFramwork/Migrations/20230222141822_testModel.cs @@ -0,0 +1,321 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional + +namespace EntityFramwork.Migrations +{ + /// + public partial class testModel : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_EntityCategorieRune_EntityPageRune_IdPageRune", + table: "EntityCategorieRune"); + + migrationBuilder.DropForeignKey( + name: "FK_EntityCategorieRune_Runes_IdRune", + table: "EntityCategorieRune"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EntityPageRune", + table: "EntityPageRune"); + + migrationBuilder.DropPrimaryKey( + name: "PK_EntityCategorieRune", + table: "EntityCategorieRune"); + + migrationBuilder.RenameTable( + name: "EntityPageRune", + newName: "PageRunes"); + + migrationBuilder.RenameTable( + name: "EntityCategorieRune", + newName: "CategorieRunes"); + + migrationBuilder.RenameIndex( + name: "IX_EntityCategorieRune_IdRune", + table: "CategorieRunes", + newName: "IX_CategorieRunes_IdRune"); + + migrationBuilder.RenameIndex( + name: "IX_EntityCategorieRune_IdPageRune", + table: "CategorieRunes", + newName: "IX_CategorieRunes_IdPageRune"); + + migrationBuilder.AddPrimaryKey( + name: "PK_PageRunes", + table: "PageRunes", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_CategorieRunes", + table: "CategorieRunes", + column: "Id"); + + migrationBuilder.InsertData( + table: "Images", + columns: new[] { "Id", "Base64" }, + values: new object[,] + { + { 1, "Inconnu !" }, + { 2, "Inconnu !" }, + { 3, "Inconnu !" }, + { 4, "Inconnu !" }, + { 5, "Inconnu !" }, + { 6, "Inconnu !" }, + { 7, "Inconnu !" }, + { 8, "Inconnu !" }, + { 9, "Inconnu !" }, + { 10, "Inconnu !" }, + { 11, "Inconnu !" }, + { 12, "Inconnu !" }, + { 13, "Inconnu !" }, + { 14, "Inconnu !" }, + { 15, "Inconnu !" }, + { 16, "Inconnu !" }, + { 17, "Inconnu !" }, + { 18, "Inconnu !" }, + { 19, "Inconnu !" }, + { 20, "Inconnu !" }, + { 21, "Inconnu !" }, + { 22, "Inconnu !" }, + { 23, "Inconnu !" }, + { 24, "Inconnu !" }, + { 25, "Inconnu !" }, + { 26, "Inconnu !" }, + { 27, "Inconnu !" }, + { 28, "Inconnu !" }, + { 29, "Inconnu !" } + }); + + migrationBuilder.AddForeignKey( + name: "FK_CategorieRunes_PageRunes_IdPageRune", + table: "CategorieRunes", + column: "IdPageRune", + principalTable: "PageRunes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_CategorieRunes_Runes_IdRune", + table: "CategorieRunes", + column: "IdRune", + principalTable: "Runes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_CategorieRunes_PageRunes_IdPageRune", + table: "CategorieRunes"); + + migrationBuilder.DropForeignKey( + name: "FK_CategorieRunes_Runes_IdRune", + table: "CategorieRunes"); + + migrationBuilder.DropPrimaryKey( + name: "PK_PageRunes", + table: "PageRunes"); + + migrationBuilder.DropPrimaryKey( + name: "PK_CategorieRunes", + table: "CategorieRunes"); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 1); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 2); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 3); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 4); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 5); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 6); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 7); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 8); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 9); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 10); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 11); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 12); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 13); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 14); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 15); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 16); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 17); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 18); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 19); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 20); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 21); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 22); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 23); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 24); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 25); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 26); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 27); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 28); + + migrationBuilder.DeleteData( + table: "Images", + keyColumn: "Id", + keyValue: 29); + + migrationBuilder.RenameTable( + name: "PageRunes", + newName: "EntityPageRune"); + + migrationBuilder.RenameTable( + name: "CategorieRunes", + newName: "EntityCategorieRune"); + + migrationBuilder.RenameIndex( + name: "IX_CategorieRunes_IdRune", + table: "EntityCategorieRune", + newName: "IX_EntityCategorieRune_IdRune"); + + migrationBuilder.RenameIndex( + name: "IX_CategorieRunes_IdPageRune", + table: "EntityCategorieRune", + newName: "IX_EntityCategorieRune_IdPageRune"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EntityPageRune", + table: "EntityPageRune", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_EntityCategorieRune", + table: "EntityCategorieRune", + column: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_EntityCategorieRune_EntityPageRune_IdPageRune", + table: "EntityCategorieRune", + column: "IdPageRune", + principalTable: "EntityPageRune", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_EntityCategorieRune_Runes_IdRune", + table: "EntityCategorieRune", + column: "IdRune", + principalTable: "Runes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + } +} diff --git a/Sources/EntityFramwork/Migrations/BDDContextModelSnapshot.cs b/Sources/EntityFramwork/Migrations/BDDContextModelSnapshot.cs index c58c5bb..ab10027 100644 --- a/Sources/EntityFramwork/Migrations/BDDContextModelSnapshot.cs +++ b/Sources/EntityFramwork/Migrations/BDDContextModelSnapshot.cs @@ -26,6 +26,10 @@ namespace EntityFramwork.Migrations .IsRequired() .HasColumnType("TEXT"); + b.Property("Classe") + .IsRequired() + .HasColumnType("TEXT"); + b.Property("Icon") .IsRequired() .HasColumnType("TEXT"); @@ -48,6 +52,31 @@ namespace EntityFramwork.Migrations b.ToTable("Champions"); }); + modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Category") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("IdPageRune") + .HasColumnType("INTEGER"); + + b.Property("IdRune") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("IdPageRune"); + + b.HasIndex("IdRune"); + + b.ToTable("CategorieRunes"); + }); + modelBuilder.Entity("EntityFramwork.EntityLargeImage", b => { b.Property("Id") @@ -61,6 +90,168 @@ namespace EntityFramwork.Migrations b.HasKey("Id"); b.ToTable("Images"); + + b.HasData( + new + { + Id = 1, + Base64 = "Inconnu !" + }, + new + { + Id = 2, + Base64 = "Inconnu !" + }, + new + { + Id = 3, + Base64 = "Inconnu !" + }, + new + { + Id = 4, + Base64 = "Inconnu !" + }, + new + { + Id = 5, + Base64 = "Inconnu !" + }, + new + { + Id = 6, + Base64 = "Inconnu !" + }, + new + { + Id = 7, + Base64 = "Inconnu !" + }, + new + { + Id = 8, + Base64 = "Inconnu !" + }, + new + { + Id = 9, + Base64 = "Inconnu !" + }, + new + { + Id = 10, + Base64 = "Inconnu !" + }, + new + { + Id = 11, + Base64 = "Inconnu !" + }, + new + { + Id = 12, + Base64 = "Inconnu !" + }, + new + { + Id = 13, + Base64 = "Inconnu !" + }, + new + { + Id = 14, + Base64 = "Inconnu !" + }, + new + { + Id = 15, + Base64 = "Inconnu !" + }, + new + { + Id = 16, + Base64 = "Inconnu !" + }, + new + { + Id = 17, + Base64 = "Inconnu !" + }, + new + { + Id = 18, + Base64 = "Inconnu !" + }, + new + { + Id = 19, + Base64 = "Inconnu !" + }, + new + { + Id = 20, + Base64 = "Inconnu !" + }, + new + { + Id = 21, + Base64 = "Inconnu !" + }, + new + { + Id = 22, + Base64 = "Inconnu !" + }, + new + { + Id = 23, + Base64 = "Inconnu !" + }, + new + { + Id = 24, + Base64 = "Inconnu !" + }, + new + { + Id = 25, + Base64 = "Inconnu !" + }, + new + { + Id = 26, + Base64 = "Inconnu !" + }, + new + { + Id = 27, + Base64 = "Inconnu !" + }, + new + { + Id = 28, + Base64 = "Inconnu !" + }, + new + { + Id = 29, + Base64 = "Inconnu !" + }); + }); + + modelBuilder.Entity("EntityFramwork.EntityPageRune", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("PageRunes"); }); modelBuilder.Entity("EntityFramwork.EntityRunes", b => @@ -73,6 +264,10 @@ namespace EntityFramwork.Migrations .IsRequired() .HasColumnType("TEXT"); + b.Property("Family") + .IsRequired() + .HasColumnType("TEXT"); + b.Property("Icon") .IsRequired() .HasColumnType("TEXT"); @@ -92,13 +287,41 @@ namespace EntityFramwork.Migrations b.ToTable("Runes"); }); + modelBuilder.Entity("EntityFramwork.EntitySkill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ChampionId") + .HasColumnType("INTEGER"); + + b.Property("Description") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Type") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ChampionId"); + + b.ToTable("Skills"); + }); + modelBuilder.Entity("EntityFramwork.EntitySkins", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); - b.Property("ChampionForeignKey") + b.Property("ChampionId") .HasColumnType("INTEGER"); b.Property("Description") @@ -117,7 +340,7 @@ namespace EntityFramwork.Migrations b.HasKey("Id"); - b.HasIndex("ChampionForeignKey"); + b.HasIndex("ChampionId"); b.HasIndex("ImageId") .IsUnique(); @@ -136,6 +359,25 @@ namespace EntityFramwork.Migrations b.Navigation("Image"); }); + modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b => + { + b.HasOne("EntityFramwork.EntityPageRune", "PageRune") + .WithMany("CategorieRune") + .HasForeignKey("IdPageRune") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("EntityFramwork.EntityRunes", "Rune") + .WithMany("CategorieRune") + .HasForeignKey("IdRune") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PageRune"); + + b.Navigation("Rune"); + }); + modelBuilder.Entity("EntityFramwork.EntityRunes", b => { b.HasOne("EntityFramwork.EntityLargeImage", "Image") @@ -147,11 +389,22 @@ namespace EntityFramwork.Migrations b.Navigation("Image"); }); + modelBuilder.Entity("EntityFramwork.EntitySkill", b => + { + b.HasOne("DTO.EntityChampions", "Champions") + .WithMany("Skills") + .HasForeignKey("ChampionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Champions"); + }); + modelBuilder.Entity("EntityFramwork.EntitySkins", b => { b.HasOne("DTO.EntityChampions", "Champion") .WithMany("Skins") - .HasForeignKey("ChampionForeignKey") + .HasForeignKey("ChampionId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -168,6 +421,8 @@ namespace EntityFramwork.Migrations modelBuilder.Entity("DTO.EntityChampions", b => { + b.Navigation("Skills"); + b.Navigation("Skins"); }); @@ -182,6 +437,16 @@ namespace EntityFramwork.Migrations b.Navigation("Skin") .IsRequired(); }); + + modelBuilder.Entity("EntityFramwork.EntityPageRune", b => + { + b.Navigation("CategorieRune"); + }); + + modelBuilder.Entity("EntityFramwork.EntityRunes", b => + { + b.Navigation("CategorieRune"); + }); #pragma warning restore 612, 618 } }