From 5a449305c8b1ba7ea0f994cfa313ecc8dc11e66f Mon Sep 17 00:00:00 2001 From: Jolys Enzo Date: Wed, 1 Mar 2023 15:18:39 +0100 Subject: [PATCH] stub database --- Sources/EntityFramwork/BDD-APILOL.db | Bin 94208 -> 77824 bytes Sources/EntityFramwork/BDDContext.cs | 69 +++- Sources/EntityFramwork/EntitySkins.cs | 2 + Sources/EntityFramwork/Factories/Factories.cs | 1 + .../20230208221227_test.Designer.cs | 191 ---------- .../Migrations/20230208221227_test.cs | 145 -------- .../20230222130004_final.Designer.cs | 309 ---------------- .../Migrations/20230222130004_final.cs | 170 --------- .../20230222130958_final2.Designer.cs | 309 ---------------- .../Migrations/20230222130958_final2.cs | 22 -- .../Migrations/20230222141822_testModel.cs | 321 ----------------- ...igner.cs => 20230301140337_tp.Designer.cs} | 251 ++++++++++++- .../Migrations/20230301140337_tp.cs | 341 ++++++++++++++++++ .../Migrations/BDDContextModelSnapshot.cs | 247 +++++++++++++ .../enums/CategoriePageRune.cs} | 10 +- 15 files changed, 913 insertions(+), 1475 deletions(-) delete mode 100644 Sources/EntityFramwork/Migrations/20230208221227_test.Designer.cs delete mode 100644 Sources/EntityFramwork/Migrations/20230208221227_test.cs delete mode 100644 Sources/EntityFramwork/Migrations/20230222130004_final.Designer.cs delete mode 100644 Sources/EntityFramwork/Migrations/20230222130004_final.cs delete mode 100644 Sources/EntityFramwork/Migrations/20230222130958_final2.Designer.cs delete mode 100644 Sources/EntityFramwork/Migrations/20230222130958_final2.cs delete mode 100644 Sources/EntityFramwork/Migrations/20230222141822_testModel.cs rename Sources/EntityFramwork/Migrations/{20230222141822_testModel.Designer.cs => 20230301140337_tp.Designer.cs} (61%) create mode 100644 Sources/EntityFramwork/Migrations/20230301140337_tp.cs rename Sources/{EntityFramwork/EntityRunePage.cs => Model/enums/CategoriePageRune.cs} (50%) diff --git a/Sources/EntityFramwork/BDD-APILOL.db b/Sources/EntityFramwork/BDD-APILOL.db index 1627c5b65a09d04b1f7ad3707c545980146f3e87..de9e1230691c98de72efd886af21f105c447400a 100644 GIT binary patch delta 2099 zcmaJ>Yitx%6rMA8c4qFr&hD1FmRhE7fj}v(f-#D;1(H$<4W%GLS%CMWhC=6Db#6T0m=kQp#H8d4^BJjSy zUj0CRSvo-OlYOL2JSwh+Yp@$MCmJ~@CSp#tQUhh~&Q0*Ns7KxR5>O8@_sax4B_<>8 zvCYs3QTP02SSBXW*~73A=ZLZl!p>Et5zwLPatJxA)p_h6s@6L1sCD9a(EVf!w76y; zsP5e@&;|kbo9AE&1YL70tR;J2^t-G2U@insWcuJcn7yx>D)D$6UeU7p_H?p0Wtg^S z{O+flz;M^~Lz$BZtaQfd0r%iGSnHnN2oJeyH$(p;FYQv5ctr*5@0vNAPV>Xe(i407 zApx`Zg5uHd*FDJkQ8Q_KMs=?FPdZ-&%H7}mA5pKpaZAiL27taNW|fOh9b=vTL49b9rQhPz_yfmHrTA@%`Y z7x4N-wC55wQ~+5NZ)t96ZEkH|y!f%^*4Cwo?8wrl=B5_E2fZoaO$MF9@>ygNEkb_O zEJb1p9v1L-ypEH222bEoJUkIy{u-K8A#w1sNBuIX;4aGriTTJp=+Lvt!Hi`jJ^6%6 z44QXCglNz)qz{i68Pk?SB3t(8gVR7iFrv<3wzjLd7=n`m{)Ru{B#ZJZbS9r^ipW?d z-~~L6ucMAnV%bDAazC7FkQJd))5@VOZP;1e>NE#3ra4+&Q*buuW=d}GDMGoXRYJRN z?I>&&oZiuqk&Kn~&6O0PLer|CEoBesW?{eJbn8~i9@b5%mUx6YcJYv96!r^FH`78M z6+OC2Xw$P+W>;ae;H)wRhq6gaYy?GM6;VaoQhK@sTbpg`wr!aC+>8l$4v*j%OVq@y z$WF}7XTfM(U4gjR=`&MiX3UH&WHB*p&4aKjGQ)E z$p?5yz$yF;53z!I19R0xW)!7@n~sUph#XN>;*P#_));0*B~}54#A&gxcHK4x_`Nhd zA>a?JRNuxlc4B?_pYSC6Ya$kTH=L`XD$lSA(4N)@QpGefHmE9>${;J#JCfE|CR3tP zeBlOV2G%jYJ!w_EavJTF6IEp*L%ogUJ#- zrR3lF0v`}R;|12Fr*TP;_=GsXy6jNWA|xn!t8T;0Sfc0$wxYCKe<5S>5k&BgfPdpX zyu;33#W_9#KnS;@NC>4RF!iM{GG3nM!C%<8xSWrKBW0OepO0HfDt-2pfOqj0USnhB zYdpoy9>*?~lmj0Uz5ro;n;$B&pN*&dNRU(#&vz*Y^4=%jrq|$NKJ429{>6xIGr}p< z_|-8_T2zz>&`1ew^Gn4?@hsQ&2OEU9SeCEgMLdsZ8R^HkhT~<*txx4vQalDvv*>9S zC5ccV+!QiO@yv8+c!R0_5x>W8@eE`95Fh8~(PIpIj3JLP=rIO7M!%Ou>Pb;ODayYa C=nh-} delta 3180 zcmeHJT})e59KYwDdwXwh@9pUa^wLtG+ySGRgK|q{h-`tb2!p}KAR*3JYv`~F1=lW) z#Do>Pp(ab#oToh)mzcN*x5U^)L;NIh5BRibqM1I3F~)3fzU*buczW8hw(Icg#h5*u z&;R-V&hLEw{^z#2bKCr-dMjiYMkUEc5=&Bh<}tq?G96(TPg(%oBRS(h_mtc63295* z5Ql|rVMS;(e8m6Gt+CI5&w-EGVm31wT@Z6)qjvl=XajaEvj7-@P~Z2IS;YZ zjV|Lm z!e_2E!9YFEFHjG<9W)d0L1`1aO)mVKq?$a3Lqh}8V^f~Jd-101z@w&To9(=yHZ_6s zXQ*fJg~-BEY%!kLsTlB=CW@eWwBURsk%(%ZsnE=nXMBRB>9MhL&{yz}%CGo38pU6k zzo{jUvsP9}&Y?7eenL0UJ1CvCT9RnR!@+)4_vwD0uIpXhT?ceMoQx)tM;B+K^F1BD z4!r@wp8F&GzTUur@TpilGOts!n}vZ=v(ML^H&bgpfc}EjN1(fOy@$e6qr@-@p>&x+ zx6w`X0lG{my^iMGupc~(5$A+G_l>1wU>yvUT6TD_4(K=L@yaN?@8c{ohqf4W7u`YM zqAfD}HFTs=jGiJC7nZ{0w#gi95{tJkVTI5umVICeiG@xuvOxZfM1u&RD$)y*+iJ#= zwZ8WQ%3P^8R5Z!5ORfK+X~`q!@E9veVqr?Fp#t=8FwhiGK(mn2oJTyS?2g!>h#QPi zSYc4B`8#u8K{5)0@u!jj?ZL@RrjIpD<6p?zeIy{{#yt{{|A2tBkXs$uuY#0Nj2Yb@Zk^iO3(~Sv$d&8xe2Mq({;z_yEd`({2V{|+{N1D}8Wq*wXM@L9nlIw|Pd+>9D8(-oPzA4;d zOM~2ic^h1<402OqA@JQ(yfdMA3fc@V1NlxFW?97-pbl(!0}j=gCK*Yc@Pd>-#n%aH zh}69JB6MPna{w#u<;ErRHfzs?OzS6chHC~EoaOr1Wj6(}5RhT9zS7a0bA+ij7w%IU zfr_72)+++BE<)rJH5DjCW38!uq(-8T)mFM6JA$`UF%yu`!y>L)8gYrah^s>C{s1E; BwqpPQ diff --git a/Sources/EntityFramwork/BDDContext.cs b/Sources/EntityFramwork/BDDContext.cs index 29010e2..10888a3 100644 --- a/Sources/EntityFramwork/BDDContext.cs +++ b/Sources/EntityFramwork/BDDContext.cs @@ -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().HasKey(a => a.Id); modelBuilder.Entity().Property(a => a.Id) .ValueGeneratedOnAdd(); - modelBuilder.Entity().HasIndex(a => a.Name) .IsUnique(true); + //Clé avec skins modelBuilder.Entity() .HasMany(e => e.Skins) @@ -90,7 +96,6 @@ namespace EntityFramwork // ---------------------------------- Stub --------------------------------------// // Ajout Image - int nbImage = 29; List listImage = new List(); for( int i=1; i().HasData(listImage); // Ajout Champion + List 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().HasData(champions); + + // Ajout de skin + List 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().HasData(skins); + + // Ajout skills + List 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().HasData(skills); + + // Ajout Rune + List 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().HasData(runes); + // Ajout Rune Page + List pageRune = new() + { + new EntityPageRune() { Id = 1,Name = "Inconnu !"}, + new EntityPageRune() { Id = 2,Name = "Inconnu !"}, + new EntityPageRune() { Id = 3,Name = "Inconnu !"}, + }; + modelBuilder.Entity().HasData(pageRune); + + // Ajout Categorie Rune + List 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().HasData(categorieRune); } public DbSet Champions { get; set; } diff --git a/Sources/EntityFramwork/EntitySkins.cs b/Sources/EntityFramwork/EntitySkins.cs index f0633df..b473529 100644 --- a/Sources/EntityFramwork/EntitySkins.cs +++ b/Sources/EntityFramwork/EntitySkins.cs @@ -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; } diff --git a/Sources/EntityFramwork/Factories/Factories.cs b/Sources/EntityFramwork/Factories/Factories.cs index 001b25e..d69d63d 100644 --- a/Sources/EntityFramwork/Factories/Factories.cs +++ b/Sources/EntityFramwork/Factories/Factories.cs @@ -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; diff --git a/Sources/EntityFramwork/Migrations/20230208221227_test.Designer.cs b/Sources/EntityFramwork/Migrations/20230208221227_test.Designer.cs deleted file mode 100644 index 2a54103..0000000 --- a/Sources/EntityFramwork/Migrations/20230208221227_test.Designer.cs +++ /dev/null @@ -1,191 +0,0 @@ -// -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 - { - /// - 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("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.EntityLargeImage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Base64") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Images"); - }); - - modelBuilder.Entity("EntityFramwork.EntityRunes", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Description") - .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.EntitySkins", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChampionForeignKey") - .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("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 - } - } -} diff --git a/Sources/EntityFramwork/Migrations/20230208221227_test.cs b/Sources/EntityFramwork/Migrations/20230208221227_test.cs deleted file mode 100644 index 0853c34..0000000 --- a/Sources/EntityFramwork/Migrations/20230208221227_test.cs +++ /dev/null @@ -1,145 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace EntityFramwork.Migrations -{ - /// - public partial class test : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Images", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Base64 = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Images", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Champions", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Name = table.Column(type: "TEXT", nullable: false), - Bio = table.Column(type: "TEXT", nullable: false), - Icon = table.Column(type: "TEXT", nullable: false), - ImageId = table.Column(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(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Name = table.Column(type: "TEXT", nullable: false), - Description = table.Column(type: "TEXT", nullable: false), - Icon = table.Column(type: "TEXT", nullable: false), - ImageId = table.Column(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(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Description = table.Column(type: "TEXT", nullable: false), - Icon = table.Column(type: "TEXT", nullable: false), - Price = table.Column(type: "REAL", nullable: false), - ChampionForeignKey = table.Column(type: "INTEGER", nullable: false), - ImageId = table.Column(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); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Runes"); - - migrationBuilder.DropTable( - name: "Skins"); - - migrationBuilder.DropTable( - name: "Champions"); - - migrationBuilder.DropTable( - name: "Images"); - } - } -} diff --git a/Sources/EntityFramwork/Migrations/20230222130004_final.Designer.cs b/Sources/EntityFramwork/Migrations/20230222130004_final.Designer.cs deleted file mode 100644 index afdfaaf..0000000 --- a/Sources/EntityFramwork/Migrations/20230222130004_final.Designer.cs +++ /dev/null @@ -1,309 +0,0 @@ -// -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 deleted file mode 100644 index 2f14d1f..0000000 --- a/Sources/EntityFramwork/Migrations/20230222130004_final.cs +++ /dev/null @@ -1,170 +0,0 @@ -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 deleted file mode 100644 index 5720939..0000000 --- a/Sources/EntityFramwork/Migrations/20230222130958_final2.Designer.cs +++ /dev/null @@ -1,309 +0,0 @@ -// -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 deleted file mode 100644 index 692008a..0000000 --- a/Sources/EntityFramwork/Migrations/20230222130958_final2.cs +++ /dev/null @@ -1,22 +0,0 @@ -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.cs b/Sources/EntityFramwork/Migrations/20230222141822_testModel.cs deleted file mode 100644 index 462c049..0000000 --- a/Sources/EntityFramwork/Migrations/20230222141822_testModel.cs +++ /dev/null @@ -1,321 +0,0 @@ -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/20230222141822_testModel.Designer.cs b/Sources/EntityFramwork/Migrations/20230301140337_tp.Designer.cs similarity index 61% rename from Sources/EntityFramwork/Migrations/20230222141822_testModel.Designer.cs rename to Sources/EntityFramwork/Migrations/20230301140337_tp.Designer.cs index a73e590..b31ea5c 100644 --- a/Sources/EntityFramwork/Migrations/20230222141822_testModel.Designer.cs +++ b/Sources/EntityFramwork/Migrations/20230301140337_tp.Designer.cs @@ -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 { /// 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("ImageId") .HasColumnType("INTEGER"); + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + b.Property("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 => diff --git a/Sources/EntityFramwork/Migrations/20230301140337_tp.cs b/Sources/EntityFramwork/Migrations/20230301140337_tp.cs new file mode 100644 index 0000000..c1c6cb7 --- /dev/null +++ b/Sources/EntityFramwork/Migrations/20230301140337_tp.cs @@ -0,0 +1,341 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional + +namespace EntityFramwork.Migrations +{ + /// + public partial class tp : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Images", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Base64 = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Images", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "PageRunes", + 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_PageRunes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Champions", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Name = table.Column(type: "TEXT", nullable: false), + Bio = table.Column(type: "TEXT", nullable: false), + Icon = table.Column(type: "TEXT", nullable: false), + Classe = table.Column(type: "TEXT", nullable: false), + ImageId = table.Column(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(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Name = table.Column(type: "TEXT", nullable: false), + Description = table.Column(type: "TEXT", nullable: false), + Icon = table.Column(type: "TEXT", nullable: false), + Family = table.Column(type: "TEXT", nullable: false), + ImageId = table.Column(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(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: "Skins", + 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), + Icon = table.Column(type: "TEXT", nullable: false), + Price = table.Column(type: "REAL", nullable: false), + ChampionId = table.Column(type: "INTEGER", nullable: false), + ImageId = table.Column(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(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_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); + } + + /// + 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"); + } + } +} diff --git a/Sources/EntityFramwork/Migrations/BDDContextModelSnapshot.cs b/Sources/EntityFramwork/Migrations/BDDContextModelSnapshot.cs index ab10027..2dd17ff 100644 --- a/Sources/EntityFramwork/Migrations/BDDContextModelSnapshot.cs +++ b/Sources/EntityFramwork/Migrations/BDDContextModelSnapshot.cs @@ -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("ImageId") .HasColumnType("INTEGER"); + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + b.Property("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 => diff --git a/Sources/EntityFramwork/EntityRunePage.cs b/Sources/Model/enums/CategoriePageRune.cs similarity index 50% rename from Sources/EntityFramwork/EntityRunePage.cs rename to Sources/Model/enums/CategoriePageRune.cs index 78de44a..56ba597 100644 --- a/Sources/EntityFramwork/EntityRunePage.cs +++ b/Sources/Model/enums/CategoriePageRune.cs @@ -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 } }