stub database
continuous-integration/drone/push Build is failing Details

master
Jolys Enzo 2 years ago
parent 61c5cbff4e
commit 5a449305c8

@ -1,5 +1,11 @@
using DTO;
using Microsoft.EntityFrameworkCore;
using Model;
using static System.Net.Mime.MediaTypeNames;
using System.Diagnostics;
using System.Xml.Linq;
using System.ComponentModel;
using Model.enums;
namespace EntityFramwork
{
@ -17,9 +23,9 @@ namespace EntityFramwork
modelBuilder.Entity<EntityChampions>().HasKey(a => a.Id);
modelBuilder.Entity<EntityChampions>().Property(a => a.Id)
.ValueGeneratedOnAdd();
modelBuilder.Entity<EntityChampions>().HasIndex(a => a.Name)
.IsUnique(true);
//Clé avec skins
modelBuilder.Entity<EntityChampions>()
.HasMany(e => e.Skins)
@ -90,7 +96,6 @@ namespace EntityFramwork
// ---------------------------------- Stub --------------------------------------//
// Ajout Image
int nbImage = 29;
List<EntityLargeImage> listImage = new List<EntityLargeImage>();
for( int i=1; i<nbImage+1; i++)
@ -101,7 +106,67 @@ namespace EntityFramwork
modelBuilder.Entity<EntityLargeImage>().HasData(listImage);
// Ajout Champion
List<EntityChampions> champions = new()
{
new EntityChampions() { Id = 1,Name = "Akali", ImageId = listImage[0].Id,Classe = ChampionClass.Assassin.ToString(),Bio = "Inconnu !",Icon = "Inconnu !"},
new EntityChampions() { Id = 2, Name = "Aatrox",ImageId = listImage[1].Id, Classe = ChampionClass.Fighter.ToString(),Bio = "Inconnu !",Icon = "Inconnu !"},
new EntityChampions() { Id = 3, Name = "Ahri",ImageId = listImage[2].Id, Classe = ChampionClass.Mage.ToString(),Bio = "Inconnu !",Icon = "Inconnu !"},
new EntityChampions() { Id = 4, Name = "Akshan",ImageId = listImage[3].Id, Classe = ChampionClass.Marksman.ToString(),Bio = "Inconnu !",Icon = "Inconnu !"},
new EntityChampions() { Id = 5, Name = "Bard",ImageId = listImage[4].Id, Classe = ChampionClass.Support.ToString(),Bio = "Inconnu !",Icon = "Inconnu !"},
new EntityChampions() { Id = 6, Name = "Alistar",ImageId = listImage[5].Id, Classe = ChampionClass.Tank.ToString(),Bio = "Inconnu !",Icon = "Inconnu !"},
};
modelBuilder.Entity<EntityChampions>().HasData(champions);
// Ajout de skin
List<EntitySkins> skins = new()
{
new EntitySkins() {Id = 1,Name = "Stinger" ,ChampionId = champions[0].Id, Icon = "Inconnu !",Description = "Inconnu !",Price = 0,ImageId = listImage[6].Id},
new EntitySkins() {Id = 2,Name = "Infernal" ,ChampionId = champions[0].Id, Icon = "Inconnu !",Description = "Inconnu !",Price = 0,ImageId = listImage[7].Id},
new EntitySkins() {Id = 3,Name = "All-Star" ,ChampionId = champions[0].Id, Icon = "Inconnu !",Description = "Inconnu !",Price = 0,ImageId = listImage[8].Id},
new EntitySkins() {Id = 4,Name = "Justicar" ,ChampionId = champions[1].Id, Icon = "Inconnu !",Description = "Inconnu !",Price = 0,ImageId = listImage[9].Id},
new EntitySkins() {Id = 5,Name = "Mecha" ,ChampionId = champions[1].Id, Icon = "Inconnu !",Description = "Inconnu !",Price = 0,ImageId = listImage[10].Id},
new EntitySkins() {Id = 6,Name = "Dynasty" ,ChampionId = champions[2].Id, Icon = "Inconnu !",Description = "Inconnu !",Price = 0,ImageId = listImage[11].Id},
new EntitySkins() {Id = 7,Name = "Cyber Pop" ,ChampionId = champions[3].Id, Icon = "Inconnu !",Description = "Inconnu !",Price = 0,ImageId = listImage[12].Id},
new EntitySkins() {Id = 8,Name = "Elderwood" ,ChampionId = champions[4].Id, Icon = "Inconnu !",Description = "Inconnu !",Price = 0,ImageId = listImage[13].Id},
new EntitySkins() {Id = 9,Name = "Black" ,ChampionId = champions[5].Id, Icon = "Inconnu !",Description = "Inconnu !",Price = 0,ImageId = listImage[14].Id},
};
modelBuilder.Entity<EntitySkins>().HasData(skins);
// Ajout skills
List<EntitySkill> skills = new()
{
new EntitySkill() {Id = 1,ChampionId = champions[0].Id ,Type = SkillType.Basic.ToString(),Name = "Inconnu !",Description = "Inconnu !"},
new EntitySkill() {Id = 2,ChampionId = champions[1].Id ,Type = SkillType.Ultimate.ToString(),Name = "Inconnu !",Description = "Inconnu !"},
new EntitySkill() {Id = 3,ChampionId = champions[2].Id ,Type = SkillType.Unknown.ToString(),Name = "Inconnu !",Description = "Inconnu !"},
};
modelBuilder.Entity<EntitySkill>().HasData(skills);
// Ajout Rune
List<EntityRunes> runes = new()
{
new EntityRunes() { Id = 1,Family = RuneFamily.Precision.ToString(),ImageId = listImage[15].Id,Name = "Inconnu !",Description = "Inconnu !",Icon = "Inconnu !"},
new EntityRunes() { Id = 2,Family = RuneFamily.Domination.ToString(),ImageId = listImage[16].Id,Name = "Inconnu !",Description = "Inconnu !",Icon = "Inconnu !"},
new EntityRunes() { Id = 3,Family = RuneFamily.Unknown.ToString(),ImageId = listImage[17].Id,Name = "Inconnu !",Description = "Inconnu !",Icon = "Inconnu !"},
};
modelBuilder.Entity<EntityRunes>().HasData(runes);
// Ajout Rune Page
List<EntityPageRune> pageRune = new()
{
new EntityPageRune() { Id = 1,Name = "Inconnu !"},
new EntityPageRune() { Id = 2,Name = "Inconnu !"},
new EntityPageRune() { Id = 3,Name = "Inconnu !"},
};
modelBuilder.Entity<EntityPageRune>().HasData(pageRune);
// Ajout Categorie Rune
List<EntityCategorieRune> categorieRune = new()
{
new EntityCategorieRune() { Id = 1,Category = CategoriePageRune.Major.ToString(),IdPageRune = pageRune[0].Id , IdRune = runes[0].Id },
new EntityCategorieRune() { Id = 2,Category = CategoriePageRune.Minor.ToString(),IdPageRune = pageRune[1].Id , IdRune = runes[1].Id },
new EntityCategorieRune() { Id = 3,Category = CategoriePageRune.Other.ToString(),IdPageRune = pageRune[2].Id , IdRune = runes[2].Id },
};
modelBuilder.Entity<EntityCategorieRune>().HasData(categorieRune);
}
public DbSet<EntityChampions> Champions { get; set; }

@ -13,6 +13,8 @@ namespace EntityFramwork
public class EntitySkins
{
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Icon { get; set; }

@ -23,6 +23,7 @@ namespace EntityFramwork.Factories
entity.Price = skin.Price;
entity.Icon = skin.Icon;
entity.Name = skin.Name;
entity.Description = skin.Description;
entity.ChampionId = id;

@ -1,191 +0,0 @@
// <auto-generated />
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("20230208221227_test")]
partial class test
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
modelBuilder.Entity("DTO.EntityChampions", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Bio")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("ImageId")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ImageId")
.IsUnique();
b.HasIndex("Name")
.IsUnique();
b.ToTable("Champions");
});
modelBuilder.Entity("EntityFramwork.EntityLargeImage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Base64")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Images");
});
modelBuilder.Entity("EntityFramwork.EntityRunes", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("ImageId")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ImageId")
.IsUnique();
b.ToTable("Runes");
});
modelBuilder.Entity("EntityFramwork.EntitySkins", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("ChampionForeignKey")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("ImageId")
.HasColumnType("INTEGER");
b.Property<float>("Price")
.HasColumnType("REAL");
b.HasKey("Id");
b.HasIndex("ChampionForeignKey");
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.EntityRunes", b =>
{
b.HasOne("EntityFramwork.EntityLargeImage", "Image")
.WithOne("Rune")
.HasForeignKey("EntityFramwork.EntityRunes", "ImageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Image");
});
modelBuilder.Entity("EntityFramwork.EntitySkins", b =>
{
b.HasOne("DTO.EntityChampions", "Champion")
.WithMany("Skins")
.HasForeignKey("ChampionForeignKey")
.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("Skins");
});
modelBuilder.Entity("EntityFramwork.EntityLargeImage", b =>
{
b.Navigation("Champion")
.IsRequired();
b.Navigation("Rune")
.IsRequired();
b.Navigation("Skin")
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

@ -1,145 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EntityFramwork.Migrations
{
/// <inheritdoc />
public partial class test : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Images",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Base64 = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Images", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Champions",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
Bio = table.Column<string>(type: "TEXT", nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false),
ImageId = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Champions", x => x.Id);
table.ForeignKey(
name: "FK_Champions_Images_ImageId",
column: x => x.ImageId,
principalTable: "Images",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Runes",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false),
ImageId = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Runes", x => x.Id);
table.ForeignKey(
name: "FK_Runes_Images_ImageId",
column: x => x.ImageId,
principalTable: "Images",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Skins",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Description = table.Column<string>(type: "TEXT", nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false),
Price = table.Column<float>(type: "REAL", nullable: false),
ChampionForeignKey = table.Column<int>(type: "INTEGER", nullable: false),
ImageId = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Skins", x => x.Id);
table.ForeignKey(
name: "FK_Skins_Champions_ChampionForeignKey",
column: x => x.ChampionForeignKey,
principalTable: "Champions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Skins_Images_ImageId",
column: x => x.ImageId,
principalTable: "Images",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Champions_ImageId",
table: "Champions",
column: "ImageId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Champions_Name",
table: "Champions",
column: "Name",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Runes_ImageId",
table: "Runes",
column: "ImageId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Skins_ChampionForeignKey",
table: "Skins",
column: "ChampionForeignKey");
migrationBuilder.CreateIndex(
name: "IX_Skins_ImageId",
table: "Skins",
column: "ImageId",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Runes");
migrationBuilder.DropTable(
name: "Skins");
migrationBuilder.DropTable(
name: "Champions");
migrationBuilder.DropTable(
name: "Images");
}
}
}

@ -1,309 +0,0 @@
// <auto-generated />
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
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
modelBuilder.Entity("DTO.EntityChampions", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Bio")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Classe")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("ImageId")
.HasColumnType("INTEGER");
b.Property<string>("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<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Category")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("IdPageRune")
.HasColumnType("INTEGER");
b.Property<int>("IdRune")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("IdPageRune");
b.HasIndex("IdRune");
b.ToTable("EntityCategorieRune");
});
modelBuilder.Entity("EntityFramwork.EntityLargeImage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Base64")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Images");
});
modelBuilder.Entity("EntityFramwork.EntityPageRune", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("EntityPageRune");
});
modelBuilder.Entity("EntityFramwork.EntityRunes", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Family")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("ImageId")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ImageId")
.IsUnique();
b.ToTable("Runes");
});
modelBuilder.Entity("EntityFramwork.EntitySkill", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("ChampionId")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ChampionId");
b.ToTable("Skills");
});
modelBuilder.Entity("EntityFramwork.EntitySkins", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("ChampionId")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("ImageId")
.HasColumnType("INTEGER");
b.Property<float>("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
}
}
}

@ -1,170 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EntityFramwork.Migrations
{
/// <inheritdoc />
public partial class final : Migration
{
/// <inheritdoc />
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<string>(
name: "Family",
table: "Runes",
type: "TEXT",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "Classe",
table: "Champions",
type: "TEXT",
nullable: false,
defaultValue: "");
migrationBuilder.CreateTable(
name: "EntityPageRune",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EntityPageRune", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Skills",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
Type = table.Column<string>(type: "TEXT", nullable: false),
ChampionId = table.Column<int>(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<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Category = table.Column<string>(type: "TEXT", nullable: false),
IdPageRune = table.Column<int>(type: "INTEGER", nullable: false),
IdRune = table.Column<int>(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);
}
/// <inheritdoc />
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);
}
}
}

@ -1,309 +0,0 @@
// <auto-generated />
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
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
modelBuilder.Entity("DTO.EntityChampions", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Bio")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Classe")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("ImageId")
.HasColumnType("INTEGER");
b.Property<string>("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<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Category")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("IdPageRune")
.HasColumnType("INTEGER");
b.Property<int>("IdRune")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("IdPageRune");
b.HasIndex("IdRune");
b.ToTable("EntityCategorieRune");
});
modelBuilder.Entity("EntityFramwork.EntityLargeImage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Base64")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Images");
});
modelBuilder.Entity("EntityFramwork.EntityPageRune", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("EntityPageRune");
});
modelBuilder.Entity("EntityFramwork.EntityRunes", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Family")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("ImageId")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ImageId")
.IsUnique();
b.ToTable("Runes");
});
modelBuilder.Entity("EntityFramwork.EntitySkill", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("ChampionId")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ChampionId");
b.ToTable("Skills");
});
modelBuilder.Entity("EntityFramwork.EntitySkins", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("ChampionId")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("ImageId")
.HasColumnType("INTEGER");
b.Property<float>("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
}
}
}

@ -1,22 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EntityFramwork.Migrations
{
/// <inheritdoc />
public partial class final2 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

@ -1,321 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace EntityFramwork.Migrations
{
/// <inheritdoc />
public partial class testModel : Migration
{
/// <inheritdoc />
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);
}
/// <inheritdoc />
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);
}
}
}

@ -10,8 +10,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace EntityFramwork.Migrations
{
[DbContext(typeof(BDDContext))]
[Migration("20230222141822_testModel")]
partial class testModel
[Migration("20230301140337_tp")]
partial class tp
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -53,6 +53,62 @@ namespace EntityFramwork.Migrations
.IsUnique();
b.ToTable("Champions");
b.HasData(
new
{
Id = 1,
Bio = "Inconnu !",
Classe = "Assassin",
Icon = "Inconnu !",
ImageId = 1,
Name = "Akali"
},
new
{
Id = 2,
Bio = "Inconnu !",
Classe = "Fighter",
Icon = "Inconnu !",
ImageId = 2,
Name = "Aatrox"
},
new
{
Id = 3,
Bio = "Inconnu !",
Classe = "Mage",
Icon = "Inconnu !",
ImageId = 3,
Name = "Ahri"
},
new
{
Id = 4,
Bio = "Inconnu !",
Classe = "Marksman",
Icon = "Inconnu !",
ImageId = 4,
Name = "Akshan"
},
new
{
Id = 5,
Bio = "Inconnu !",
Classe = "Support",
Icon = "Inconnu !",
ImageId = 5,
Name = "Bard"
},
new
{
Id = 6,
Bio = "Inconnu !",
Classe = "Tank",
Icon = "Inconnu !",
ImageId = 6,
Name = "Alistar"
});
});
modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b =>
@ -78,6 +134,29 @@ namespace EntityFramwork.Migrations
b.HasIndex("IdRune");
b.ToTable("CategorieRunes");
b.HasData(
new
{
Id = 1,
Category = "Major",
IdPageRune = 1,
IdRune = 1
},
new
{
Id = 2,
Category = "Minor",
IdPageRune = 2,
IdRune = 2
},
new
{
Id = 3,
Category = "Other",
IdPageRune = 3,
IdRune = 3
});
});
modelBuilder.Entity("EntityFramwork.EntityLargeImage", b =>
@ -255,6 +334,23 @@ namespace EntityFramwork.Migrations
b.HasKey("Id");
b.ToTable("PageRunes");
b.HasData(
new
{
Id = 1,
Name = "Inconnu !"
},
new
{
Id = 2,
Name = "Inconnu !"
},
new
{
Id = 3,
Name = "Inconnu !"
});
});
modelBuilder.Entity("EntityFramwork.EntityRunes", b =>
@ -288,6 +384,35 @@ namespace EntityFramwork.Migrations
.IsUnique();
b.ToTable("Runes");
b.HasData(
new
{
Id = 1,
Description = "Inconnu !",
Family = "Precision",
Icon = "Inconnu !",
ImageId = 16,
Name = "Inconnu !"
},
new
{
Id = 2,
Description = "Inconnu !",
Family = "Domination",
Icon = "Inconnu !",
ImageId = 17,
Name = "Inconnu !"
},
new
{
Id = 3,
Description = "Inconnu !",
Family = "Unknown",
Icon = "Inconnu !",
ImageId = 18,
Name = "Inconnu !"
});
});
modelBuilder.Entity("EntityFramwork.EntitySkill", b =>
@ -316,6 +441,32 @@ namespace EntityFramwork.Migrations
b.HasIndex("ChampionId");
b.ToTable("Skills");
b.HasData(
new
{
Id = 1,
ChampionId = 1,
Description = "Inconnu !",
Name = "Inconnu !",
Type = "Basic"
},
new
{
Id = 2,
ChampionId = 2,
Description = "Inconnu !",
Name = "Inconnu !",
Type = "Ultimate"
},
new
{
Id = 3,
ChampionId = 3,
Description = "Inconnu !",
Name = "Inconnu !",
Type = "Unknown"
});
});
modelBuilder.Entity("EntityFramwork.EntitySkins", b =>
@ -338,6 +489,10 @@ namespace EntityFramwork.Migrations
b.Property<int>("ImageId")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<float>("Price")
.HasColumnType("REAL");
@ -349,6 +504,98 @@ namespace EntityFramwork.Migrations
.IsUnique();
b.ToTable("Skins");
b.HasData(
new
{
Id = 1,
ChampionId = 1,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 7,
Name = "Stinger",
Price = 0f
},
new
{
Id = 2,
ChampionId = 1,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 8,
Name = "Infernal",
Price = 0f
},
new
{
Id = 3,
ChampionId = 1,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 9,
Name = "All-Star",
Price = 0f
},
new
{
Id = 4,
ChampionId = 2,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 10,
Name = "Justicar",
Price = 0f
},
new
{
Id = 5,
ChampionId = 2,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 11,
Name = "Mecha",
Price = 0f
},
new
{
Id = 6,
ChampionId = 3,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 12,
Name = "Dynasty",
Price = 0f
},
new
{
Id = 7,
ChampionId = 4,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 13,
Name = "Cyber Pop",
Price = 0f
},
new
{
Id = 8,
ChampionId = 5,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 14,
Name = "Elderwood",
Price = 0f
},
new
{
Id = 9,
ChampionId = 6,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 15,
Name = "Black",
Price = 0f
});
});
modelBuilder.Entity("DTO.EntityChampions", b =>

@ -0,0 +1,341 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace EntityFramwork.Migrations
{
/// <inheritdoc />
public partial class tp : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Images",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Base64 = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Images", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PageRunes",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PageRunes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Champions",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
Bio = table.Column<string>(type: "TEXT", nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false),
Classe = table.Column<string>(type: "TEXT", nullable: false),
ImageId = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Champions", x => x.Id);
table.ForeignKey(
name: "FK_Champions_Images_ImageId",
column: x => x.ImageId,
principalTable: "Images",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Runes",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false),
Family = table.Column<string>(type: "TEXT", nullable: false),
ImageId = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Runes", x => x.Id);
table.ForeignKey(
name: "FK_Runes_Images_ImageId",
column: x => x.ImageId,
principalTable: "Images",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Skills",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
Type = table.Column<string>(type: "TEXT", nullable: false),
ChampionId = table.Column<int>(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: "Skins",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false),
Price = table.Column<float>(type: "REAL", nullable: false),
ChampionId = table.Column<int>(type: "INTEGER", nullable: false),
ImageId = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Skins", x => x.Id);
table.ForeignKey(
name: "FK_Skins_Champions_ChampionId",
column: x => x.ChampionId,
principalTable: "Champions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Skins_Images_ImageId",
column: x => x.ImageId,
principalTable: "Images",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "CategorieRunes",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Category = table.Column<string>(type: "TEXT", nullable: false),
IdPageRune = table.Column<int>(type: "INTEGER", nullable: false),
IdRune = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CategorieRunes", x => x.Id);
table.ForeignKey(
name: "FK_CategorieRunes_PageRunes_IdPageRune",
column: x => x.IdPageRune,
principalTable: "PageRunes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_CategorieRunes_Runes_IdRune",
column: x => x.IdRune,
principalTable: "Runes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
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.InsertData(
table: "PageRunes",
columns: new[] { "Id", "Name" },
values: new object[,]
{
{ 1, "Inconnu !" },
{ 2, "Inconnu !" },
{ 3, "Inconnu !" }
});
migrationBuilder.InsertData(
table: "Champions",
columns: new[] { "Id", "Bio", "Classe", "Icon", "ImageId", "Name" },
values: new object[,]
{
{ 1, "Inconnu !", "Assassin", "Inconnu !", 1, "Akali" },
{ 2, "Inconnu !", "Fighter", "Inconnu !", 2, "Aatrox" },
{ 3, "Inconnu !", "Mage", "Inconnu !", 3, "Ahri" },
{ 4, "Inconnu !", "Marksman", "Inconnu !", 4, "Akshan" },
{ 5, "Inconnu !", "Support", "Inconnu !", 5, "Bard" },
{ 6, "Inconnu !", "Tank", "Inconnu !", 6, "Alistar" }
});
migrationBuilder.InsertData(
table: "Runes",
columns: new[] { "Id", "Description", "Family", "Icon", "ImageId", "Name" },
values: new object[,]
{
{ 1, "Inconnu !", "Precision", "Inconnu !", 16, "Inconnu !" },
{ 2, "Inconnu !", "Domination", "Inconnu !", 17, "Inconnu !" },
{ 3, "Inconnu !", "Unknown", "Inconnu !", 18, "Inconnu !" }
});
migrationBuilder.InsertData(
table: "CategorieRunes",
columns: new[] { "Id", "Category", "IdPageRune", "IdRune" },
values: new object[,]
{
{ 1, "Major", 1, 1 },
{ 2, "Minor", 2, 2 },
{ 3, "Other", 3, 3 }
});
migrationBuilder.InsertData(
table: "Skills",
columns: new[] { "Id", "ChampionId", "Description", "Name", "Type" },
values: new object[,]
{
{ 1, 1, "Inconnu !", "Inconnu !", "Basic" },
{ 2, 2, "Inconnu !", "Inconnu !", "Ultimate" },
{ 3, 3, "Inconnu !", "Inconnu !", "Unknown" }
});
migrationBuilder.InsertData(
table: "Skins",
columns: new[] { "Id", "ChampionId", "Description", "Icon", "ImageId", "Name", "Price" },
values: new object[,]
{
{ 1, 1, "Inconnu !", "Inconnu !", 7, "Stinger", 0f },
{ 2, 1, "Inconnu !", "Inconnu !", 8, "Infernal", 0f },
{ 3, 1, "Inconnu !", "Inconnu !", 9, "All-Star", 0f },
{ 4, 2, "Inconnu !", "Inconnu !", 10, "Justicar", 0f },
{ 5, 2, "Inconnu !", "Inconnu !", 11, "Mecha", 0f },
{ 6, 3, "Inconnu !", "Inconnu !", 12, "Dynasty", 0f },
{ 7, 4, "Inconnu !", "Inconnu !", 13, "Cyber Pop", 0f },
{ 8, 5, "Inconnu !", "Inconnu !", 14, "Elderwood", 0f },
{ 9, 6, "Inconnu !", "Inconnu !", 15, "Black", 0f }
});
migrationBuilder.CreateIndex(
name: "IX_CategorieRunes_IdPageRune",
table: "CategorieRunes",
column: "IdPageRune");
migrationBuilder.CreateIndex(
name: "IX_CategorieRunes_IdRune",
table: "CategorieRunes",
column: "IdRune");
migrationBuilder.CreateIndex(
name: "IX_Champions_ImageId",
table: "Champions",
column: "ImageId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Champions_Name",
table: "Champions",
column: "Name",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Runes_ImageId",
table: "Runes",
column: "ImageId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Skills_ChampionId",
table: "Skills",
column: "ChampionId");
migrationBuilder.CreateIndex(
name: "IX_Skins_ChampionId",
table: "Skins",
column: "ChampionId");
migrationBuilder.CreateIndex(
name: "IX_Skins_ImageId",
table: "Skins",
column: "ImageId",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CategorieRunes");
migrationBuilder.DropTable(
name: "Skills");
migrationBuilder.DropTable(
name: "Skins");
migrationBuilder.DropTable(
name: "PageRunes");
migrationBuilder.DropTable(
name: "Runes");
migrationBuilder.DropTable(
name: "Champions");
migrationBuilder.DropTable(
name: "Images");
}
}
}

@ -50,6 +50,62 @@ namespace EntityFramwork.Migrations
.IsUnique();
b.ToTable("Champions");
b.HasData(
new
{
Id = 1,
Bio = "Inconnu !",
Classe = "Assassin",
Icon = "Inconnu !",
ImageId = 1,
Name = "Akali"
},
new
{
Id = 2,
Bio = "Inconnu !",
Classe = "Fighter",
Icon = "Inconnu !",
ImageId = 2,
Name = "Aatrox"
},
new
{
Id = 3,
Bio = "Inconnu !",
Classe = "Mage",
Icon = "Inconnu !",
ImageId = 3,
Name = "Ahri"
},
new
{
Id = 4,
Bio = "Inconnu !",
Classe = "Marksman",
Icon = "Inconnu !",
ImageId = 4,
Name = "Akshan"
},
new
{
Id = 5,
Bio = "Inconnu !",
Classe = "Support",
Icon = "Inconnu !",
ImageId = 5,
Name = "Bard"
},
new
{
Id = 6,
Bio = "Inconnu !",
Classe = "Tank",
Icon = "Inconnu !",
ImageId = 6,
Name = "Alistar"
});
});
modelBuilder.Entity("EntityFramwork.EntityCategorieRune", b =>
@ -75,6 +131,29 @@ namespace EntityFramwork.Migrations
b.HasIndex("IdRune");
b.ToTable("CategorieRunes");
b.HasData(
new
{
Id = 1,
Category = "Major",
IdPageRune = 1,
IdRune = 1
},
new
{
Id = 2,
Category = "Minor",
IdPageRune = 2,
IdRune = 2
},
new
{
Id = 3,
Category = "Other",
IdPageRune = 3,
IdRune = 3
});
});
modelBuilder.Entity("EntityFramwork.EntityLargeImage", b =>
@ -252,6 +331,23 @@ namespace EntityFramwork.Migrations
b.HasKey("Id");
b.ToTable("PageRunes");
b.HasData(
new
{
Id = 1,
Name = "Inconnu !"
},
new
{
Id = 2,
Name = "Inconnu !"
},
new
{
Id = 3,
Name = "Inconnu !"
});
});
modelBuilder.Entity("EntityFramwork.EntityRunes", b =>
@ -285,6 +381,35 @@ namespace EntityFramwork.Migrations
.IsUnique();
b.ToTable("Runes");
b.HasData(
new
{
Id = 1,
Description = "Inconnu !",
Family = "Precision",
Icon = "Inconnu !",
ImageId = 16,
Name = "Inconnu !"
},
new
{
Id = 2,
Description = "Inconnu !",
Family = "Domination",
Icon = "Inconnu !",
ImageId = 17,
Name = "Inconnu !"
},
new
{
Id = 3,
Description = "Inconnu !",
Family = "Unknown",
Icon = "Inconnu !",
ImageId = 18,
Name = "Inconnu !"
});
});
modelBuilder.Entity("EntityFramwork.EntitySkill", b =>
@ -313,6 +438,32 @@ namespace EntityFramwork.Migrations
b.HasIndex("ChampionId");
b.ToTable("Skills");
b.HasData(
new
{
Id = 1,
ChampionId = 1,
Description = "Inconnu !",
Name = "Inconnu !",
Type = "Basic"
},
new
{
Id = 2,
ChampionId = 2,
Description = "Inconnu !",
Name = "Inconnu !",
Type = "Ultimate"
},
new
{
Id = 3,
ChampionId = 3,
Description = "Inconnu !",
Name = "Inconnu !",
Type = "Unknown"
});
});
modelBuilder.Entity("EntityFramwork.EntitySkins", b =>
@ -335,6 +486,10 @@ namespace EntityFramwork.Migrations
b.Property<int>("ImageId")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<float>("Price")
.HasColumnType("REAL");
@ -346,6 +501,98 @@ namespace EntityFramwork.Migrations
.IsUnique();
b.ToTable("Skins");
b.HasData(
new
{
Id = 1,
ChampionId = 1,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 7,
Name = "Stinger",
Price = 0f
},
new
{
Id = 2,
ChampionId = 1,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 8,
Name = "Infernal",
Price = 0f
},
new
{
Id = 3,
ChampionId = 1,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 9,
Name = "All-Star",
Price = 0f
},
new
{
Id = 4,
ChampionId = 2,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 10,
Name = "Justicar",
Price = 0f
},
new
{
Id = 5,
ChampionId = 2,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 11,
Name = "Mecha",
Price = 0f
},
new
{
Id = 6,
ChampionId = 3,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 12,
Name = "Dynasty",
Price = 0f
},
new
{
Id = 7,
ChampionId = 4,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 13,
Name = "Cyber Pop",
Price = 0f
},
new
{
Id = 8,
ChampionId = 5,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 14,
Name = "Elderwood",
Price = 0f
},
new
{
Id = 9,
ChampionId = 6,
Description = "Inconnu !",
Icon = "Inconnu !",
ImageId = 15,
Name = "Black",
Price = 0f
});
});
modelBuilder.Entity("DTO.EntityChampions", b =>

@ -4,11 +4,13 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EntityFramwork
namespace Model.enums
{
public class EntityRunePage
public enum CategoriePageRune
{
public int Id { get; set; }
public string Name { get; set; }
Major,
Minor,
Other
}
}
Loading…
Cancel
Save