diff --git a/Sources/EntityFramwork/BDD-APILOL.db b/Sources/EntityFramwork/BDD-APILOL.db index a7df7d8..1627c5b 100644 Binary files a/Sources/EntityFramwork/BDD-APILOL.db and b/Sources/EntityFramwork/BDD-APILOL.db differ diff --git a/Sources/EntityFramwork/BDD-APILOL.db-shm b/Sources/EntityFramwork/BDD-APILOL.db-shm deleted file mode 100644 index fe9ac28..0000000 Binary files a/Sources/EntityFramwork/BDD-APILOL.db-shm and /dev/null differ diff --git a/Sources/EntityFramwork/BDD-APILOL.db-wal b/Sources/EntityFramwork/BDD-APILOL.db-wal deleted file mode 100644 index e69de29..0000000 diff --git a/Sources/EntityFramwork/BDDContext.cs b/Sources/EntityFramwork/BDDContext.cs index 9ae0aa8..29010e2 100644 --- a/Sources/EntityFramwork/BDDContext.cs +++ b/Sources/EntityFramwork/BDDContext.cs @@ -62,11 +62,46 @@ namespace EntityFramwork modelBuilder.Entity().HasKey(c => c.Id); modelBuilder.Entity().Property(c => c.Id) .ValueGeneratedOnAdd(); + + modelBuilder.Entity().HasMany(e => e.CategorieRune) + .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 } }