From ada4790aa68e03a7bbe98e35ebe8c4e839ab0c40 Mon Sep 17 00:00:00 2001 From: PATRICK Date: Mon, 1 Apr 2024 00:24:09 +0200 Subject: [PATCH] fix --- Project/EntityFramework/API/API.csproj | 4 - .../API/Db.in_english_please.db | Bin 106496 -> 106496 bytes .../EntityFramework/DbContext/SAEContext.cs | 6 - .../20240331212614_newMigs.Designer.cs | 416 ------------------ .../Migrations/20240331212614_newMigs.cs | 310 ------------- ....cs => 20240331221744_newMigs.Designer.cs} | 6 +- ...7_newMigs.cs => 20240331221744_newMigs.cs} | 0 7 files changed, 1 insertion(+), 741 deletions(-) delete mode 100644 Project/EntityFramework/StubbedContext/Migrations/20240331212614_newMigs.Designer.cs delete mode 100644 Project/EntityFramework/StubbedContext/Migrations/20240331212614_newMigs.cs rename Project/EntityFramework/StubbedContext/Migrations/{20240330163827_newMigs.Designer.cs => 20240331221744_newMigs.Designer.cs} (97%) rename Project/EntityFramework/StubbedContext/Migrations/{20240330163827_newMigs.cs => 20240331221744_newMigs.cs} (100%) diff --git a/Project/EntityFramework/API/API.csproj b/Project/EntityFramework/API/API.csproj index d0bd6c4..0a29e7c 100644 --- a/Project/EntityFramework/API/API.csproj +++ b/Project/EntityFramework/API/API.csproj @@ -5,11 +5,7 @@ enable enable $(MSBuildProjectDirectory) -<<<<<<< HEAD - 30f8a49f-7e7d-4394-80f0-b36f39b45831 -======= 1540d456-1696-425e-b511-611542ce7c5e ->>>>>>> master Linux diff --git a/Project/EntityFramework/API/Db.in_english_please.db b/Project/EntityFramework/API/Db.in_english_please.db index d85099670d0640e3c9b9834c3729d8eabd21dc62..5f360cf045ca747bbfa306192bb8c569ee7dac40 100644 GIT binary patch delta 39 pcmZoTz}9epZNnRRc0(g0Lvs_8&7bA}@xwUHKlHc%&}ZZ*0019D4f6m1 delta 39 pcmZoTz}9epZNnRRb^}8*V+$km&7bA}@xwUHKlHc%&}ZZ*001B#4gUZD diff --git a/Project/EntityFramework/DbContext/SAEContext.cs b/Project/EntityFramework/DbContext/SAEContext.cs index 6c3cc29..62d17c3 100644 --- a/Project/EntityFramework/DbContext/SAEContext.cs +++ b/Project/EntityFramework/DbContext/SAEContext.cs @@ -15,12 +15,6 @@ namespace DbContextLib public DbSet Vocabularys { get; set; } public DbSet VocabularyLists { get; set; } -<<<<<<< HEAD - - -======= ->>>>>>> master - //permet de créer une base de donnée (fichier .db) ici en Sqlite avec le nom Db.Books.db public SAEContext(DbContextOptions options): base(options) diff --git a/Project/EntityFramework/StubbedContext/Migrations/20240331212614_newMigs.Designer.cs b/Project/EntityFramework/StubbedContext/Migrations/20240331212614_newMigs.Designer.cs deleted file mode 100644 index 5cfe892..0000000 --- a/Project/EntityFramework/StubbedContext/Migrations/20240331212614_newMigs.Designer.cs +++ /dev/null @@ -1,416 +0,0 @@ -// -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using StubbedContextLib; - -#nullable disable - -namespace StubbedContextLib.Migrations -{ - [DbContext(typeof(StubbedContext))] -<<<<<<<< HEAD:Project/EntityFramework/StubbedContext/Migrations/20240330163827_newMigs.Designer.cs - [Migration("20240330163827_newMigs")] -======== - [Migration("20240331212614_newMigs")] ->>>>>>>> master:Project/EntityFramework/StubbedContext/Migrations/20240331212614_newMigs.Designer.cs - partial class newMigs - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.1"); - - modelBuilder.Entity("Entities.GroupEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Num") - .HasColumnType("INTEGER"); - - b.Property("sector") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("year") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("Groups"); - - b.HasData( - new - { - Id = 1L, - Num = 1, - sector = "informatics", - year = 1 - }); - }); - - modelBuilder.Entity("Entities.LangueEntity", b => - { - b.Property("name") - .HasColumnType("TEXT"); - - b.HasKey("name"); - - b.ToTable("Langues"); - - b.HasData( - new - { - name = "French" - }, - new - { - name = "English" - }); - }); - - modelBuilder.Entity("Entities.RoleEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Roles"); - - b.HasData( - new - { - Id = 1L, - Name = "Admin" - }, - new - { - Id = 2L, - Name = "Teacher" - }, - new - { - Id = 3L, - Name = "Student" - }); - }); - - modelBuilder.Entity("Entities.TranslateEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("VocabularyListVocId") - .HasColumnType("INTEGER"); - - b.Property("WordsId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("VocabularyListVocId"); - - b.ToTable("Translates"); - - b.HasData( - new - { - Id = 1L, - VocabularyListVocId = 1L, - WordsId = "1" - }); - }); - - modelBuilder.Entity("Entities.UserEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Email") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ExtraTime") - .HasColumnType("INTEGER"); - - b.Property("GroupId") - .HasColumnType("INTEGER"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("NickName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Password") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("UserName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("image") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GroupId"); - - b.HasIndex("RoleId"); - - b.ToTable("Users"); - - b.HasData( - new - { - Id = 1L, - Email = "", - ExtraTime = true, - GroupId = 1L, - Name = "name", - NickName = "nickname", - Password = "1234", - RoleId = 1L, - UserName = "username" - }, - new - { - Id = 2L, - Email = "", - ExtraTime = true, - GroupId = 1L, - Name = "name2", - NickName = "nickname2", - Password = "1234", - RoleId = 2L, - UserName = "username2" - }, - new - { - Id = 3L, - Email = "", - ExtraTime = true, - GroupId = 1L, - Name = "name3", - NickName = "nickname3", - Password = "1234", - RoleId = 3L, - UserName = "username3" - }); - }); - - modelBuilder.Entity("Entities.VocabularyEntity", b => - { - b.Property("word") - .HasColumnType("TEXT"); - - b.Property("LangueName") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("word"); - - b.HasIndex("LangueName"); - - b.ToTable("Vocabularys"); - - b.HasData( - new - { - word = "Bonjour", - LangueName = "French" - }); - }); - - modelBuilder.Entity("Entities.VocabularyListEntity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Image") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("VocabularyLists"); - - b.HasData( - new - { - Id = 1L, - Image = "image1", - Name = "Liste1", - UserId = 1L - }); - }); - - modelBuilder.Entity("GroupEntityVocabularyListEntity", b => - { - b.Property("GroupVocabularyListId") - .HasColumnType("INTEGER"); - - b.Property("VocsGroupsId") - .HasColumnType("INTEGER"); - - b.HasKey("GroupVocabularyListId", "VocsGroupsId"); - - b.HasIndex("VocsGroupsId"); - - b.ToTable("GroupEntityVocabularyListEntity"); - }); - - modelBuilder.Entity("TranslateEntityVocabularyEntity", b => - { - b.Property("TransVocword") - .HasColumnType("TEXT"); - - b.Property("VoctranslationsId") - .HasColumnType("INTEGER"); - - b.HasKey("TransVocword", "VoctranslationsId"); - - b.HasIndex("VoctranslationsId"); - - b.ToTable("TranslateEntityVocabularyEntity"); - }); - - modelBuilder.Entity("Entities.TranslateEntity", b => - { - b.HasOne("Entities.VocabularyListEntity", "VocabularyListVoc") - .WithMany("translations") - .HasForeignKey("VocabularyListVocId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("VocabularyListVoc"); - }); - - modelBuilder.Entity("Entities.UserEntity", b => - { - b.HasOne("Entities.GroupEntity", "Group") - .WithMany("Users") - .HasForeignKey("GroupId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Entities.RoleEntity", "Role") - .WithMany("Users") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Group"); - - b.Navigation("Role"); - }); - - modelBuilder.Entity("Entities.VocabularyEntity", b => - { - b.HasOne("Entities.LangueEntity", "Langue") - .WithMany("vocabularys") - .HasForeignKey("LangueName") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Langue"); - }); - - modelBuilder.Entity("Entities.VocabularyListEntity", b => - { - b.HasOne("Entities.UserEntity", "User") - .WithMany("VocabularyList") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("GroupEntityVocabularyListEntity", b => - { - b.HasOne("Entities.VocabularyListEntity", null) - .WithMany() - .HasForeignKey("GroupVocabularyListId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Entities.GroupEntity", null) - .WithMany() - .HasForeignKey("VocsGroupsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("TranslateEntityVocabularyEntity", b => - { - b.HasOne("Entities.VocabularyEntity", null) - .WithMany() - .HasForeignKey("TransVocword") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Entities.TranslateEntity", null) - .WithMany() - .HasForeignKey("VoctranslationsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Entities.GroupEntity", b => - { - b.Navigation("Users"); - }); - - modelBuilder.Entity("Entities.LangueEntity", b => - { - b.Navigation("vocabularys"); - }); - - modelBuilder.Entity("Entities.RoleEntity", b => - { - b.Navigation("Users"); - }); - - modelBuilder.Entity("Entities.UserEntity", b => - { - b.Navigation("VocabularyList"); - }); - - modelBuilder.Entity("Entities.VocabularyListEntity", b => - { - b.Navigation("translations"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Project/EntityFramework/StubbedContext/Migrations/20240331212614_newMigs.cs b/Project/EntityFramework/StubbedContext/Migrations/20240331212614_newMigs.cs deleted file mode 100644 index 6377dc5..0000000 --- a/Project/EntityFramework/StubbedContext/Migrations/20240331212614_newMigs.cs +++ /dev/null @@ -1,310 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional - -namespace StubbedContextLib.Migrations -{ - /// - public partial class newMigs : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Groups", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Num = table.Column(type: "INTEGER", nullable: false), - year = table.Column(type: "INTEGER", nullable: false), - sector = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Groups", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Langues", - columns: table => new - { - name = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Langues", x => x.name); - }); - - migrationBuilder.CreateTable( - name: "Roles", - 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_Roles", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Vocabularys", - columns: table => new - { - word = table.Column(type: "TEXT", nullable: false), - LangueName = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Vocabularys", x => x.word); - table.ForeignKey( - name: "FK_Vocabularys_Langues_LangueName", - column: x => x.LangueName, - principalTable: "Langues", - principalColumn: "name", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Users", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Password = table.Column(type: "TEXT", nullable: false), - Email = table.Column(type: "TEXT", nullable: false), - Name = table.Column(type: "TEXT", nullable: false), - UserName = table.Column(type: "TEXT", nullable: false), - NickName = table.Column(type: "TEXT", nullable: false), - image = table.Column(type: "TEXT", nullable: true), - GroupId = table.Column(type: "INTEGER", nullable: false), - RoleId = table.Column(type: "INTEGER", nullable: false), - ExtraTime = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - table.ForeignKey( - name: "FK_Users_Groups_GroupId", - column: x => x.GroupId, - principalTable: "Groups", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Users_Roles_RoleId", - column: x => x.RoleId, - principalTable: "Roles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "VocabularyLists", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Name = table.Column(type: "TEXT", nullable: false), - Image = table.Column(type: "TEXT", nullable: false), - UserId = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_VocabularyLists", x => x.Id); - table.ForeignKey( - name: "FK_VocabularyLists_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "GroupEntityVocabularyListEntity", - columns: table => new - { - GroupVocabularyListId = table.Column(type: "INTEGER", nullable: false), - VocsGroupsId = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_GroupEntityVocabularyListEntity", x => new { x.GroupVocabularyListId, x.VocsGroupsId }); - table.ForeignKey( - name: "FK_GroupEntityVocabularyListEntity_Groups_VocsGroupsId", - column: x => x.VocsGroupsId, - principalTable: "Groups", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_GroupEntityVocabularyListEntity_VocabularyLists_GroupVocabularyListId", - column: x => x.GroupVocabularyListId, - principalTable: "VocabularyLists", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Translates", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - WordsId = table.Column(type: "TEXT", nullable: false), - VocabularyListVocId = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Translates", x => x.Id); - table.ForeignKey( - name: "FK_Translates_VocabularyLists_VocabularyListVocId", - column: x => x.VocabularyListVocId, - principalTable: "VocabularyLists", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "TranslateEntityVocabularyEntity", - columns: table => new - { - TransVocword = table.Column(type: "TEXT", nullable: false), - VoctranslationsId = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_TranslateEntityVocabularyEntity", x => new { x.TransVocword, x.VoctranslationsId }); - table.ForeignKey( - name: "FK_TranslateEntityVocabularyEntity_Translates_VoctranslationsId", - column: x => x.VoctranslationsId, - principalTable: "Translates", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_TranslateEntityVocabularyEntity_Vocabularys_TransVocword", - column: x => x.TransVocword, - principalTable: "Vocabularys", - principalColumn: "word", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.InsertData( - table: "Groups", - columns: new[] { "Id", "Num", "sector", "year" }, - values: new object[] { 1L, 1, "informatics", 1 }); - - migrationBuilder.InsertData( - table: "Langues", - column: "name", - values: new object[] - { - "English", - "French" - }); - - migrationBuilder.InsertData( - table: "Roles", - columns: new[] { "Id", "Name" }, - values: new object[,] - { - { 1L, "Admin" }, - { 2L, "Teacher" }, - { 3L, "Student" } - }); - - migrationBuilder.InsertData( - table: "Users", - columns: new[] { "Id", "Email", "ExtraTime", "GroupId", "Name", "NickName", "Password", "RoleId", "UserName", "image" }, - values: new object[,] - { - { 1L, "", true, 1L, "name", "nickname", "1234", 1L, "username", null }, - { 2L, "", true, 1L, "name2", "nickname2", "1234", 2L, "username2", null }, - { 3L, "", true, 1L, "name3", "nickname3", "1234", 3L, "username3", null } - }); - - migrationBuilder.InsertData( - table: "Vocabularys", - columns: new[] { "word", "LangueName" }, - values: new object[] { "Bonjour", "French" }); - - migrationBuilder.InsertData( - table: "VocabularyLists", - columns: new[] { "Id", "Image", "Name", "UserId" }, - values: new object[] { 1L, "image1", "Liste1", 1L }); - - migrationBuilder.InsertData( - table: "Translates", - columns: new[] { "Id", "VocabularyListVocId", "WordsId" }, - values: new object[] { 1L, 1L, "1" }); - - migrationBuilder.CreateIndex( - name: "IX_GroupEntityVocabularyListEntity_VocsGroupsId", - table: "GroupEntityVocabularyListEntity", - column: "VocsGroupsId"); - - migrationBuilder.CreateIndex( - name: "IX_TranslateEntityVocabularyEntity_VoctranslationsId", - table: "TranslateEntityVocabularyEntity", - column: "VoctranslationsId"); - - migrationBuilder.CreateIndex( - name: "IX_Translates_VocabularyListVocId", - table: "Translates", - column: "VocabularyListVocId"); - - migrationBuilder.CreateIndex( - name: "IX_Users_GroupId", - table: "Users", - column: "GroupId"); - - migrationBuilder.CreateIndex( - name: "IX_Users_RoleId", - table: "Users", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "IX_VocabularyLists_UserId", - table: "VocabularyLists", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_Vocabularys_LangueName", - table: "Vocabularys", - column: "LangueName"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "GroupEntityVocabularyListEntity"); - - migrationBuilder.DropTable( - name: "TranslateEntityVocabularyEntity"); - - migrationBuilder.DropTable( - name: "Translates"); - - migrationBuilder.DropTable( - name: "Vocabularys"); - - migrationBuilder.DropTable( - name: "VocabularyLists"); - - migrationBuilder.DropTable( - name: "Langues"); - - migrationBuilder.DropTable( - name: "Users"); - - migrationBuilder.DropTable( - name: "Groups"); - - migrationBuilder.DropTable( - name: "Roles"); - } - } -} diff --git a/Project/EntityFramework/StubbedContext/Migrations/20240330163827_newMigs.Designer.cs b/Project/EntityFramework/StubbedContext/Migrations/20240331221744_newMigs.Designer.cs similarity index 97% rename from Project/EntityFramework/StubbedContext/Migrations/20240330163827_newMigs.Designer.cs rename to Project/EntityFramework/StubbedContext/Migrations/20240331221744_newMigs.Designer.cs index 5cfe892..70330de 100644 --- a/Project/EntityFramework/StubbedContext/Migrations/20240330163827_newMigs.Designer.cs +++ b/Project/EntityFramework/StubbedContext/Migrations/20240331221744_newMigs.Designer.cs @@ -10,11 +10,7 @@ using StubbedContextLib; namespace StubbedContextLib.Migrations { [DbContext(typeof(StubbedContext))] -<<<<<<<< HEAD:Project/EntityFramework/StubbedContext/Migrations/20240330163827_newMigs.Designer.cs - [Migration("20240330163827_newMigs")] -======== - [Migration("20240331212614_newMigs")] ->>>>>>>> master:Project/EntityFramework/StubbedContext/Migrations/20240331212614_newMigs.Designer.cs + [Migration("20240331221744_newMigs")] partial class newMigs { /// diff --git a/Project/EntityFramework/StubbedContext/Migrations/20240330163827_newMigs.cs b/Project/EntityFramework/StubbedContext/Migrations/20240331221744_newMigs.cs similarity index 100% rename from Project/EntityFramework/StubbedContext/Migrations/20240330163827_newMigs.cs rename to Project/EntityFramework/StubbedContext/Migrations/20240331221744_newMigs.cs