diff --git a/WF_EF_Api/StubbedContextLib/Migrations/20250402113707_pm_api.Designer.cs b/WF_EF_Api/StubbedContextLib/Migrations/20250402113707_pm_api.Designer.cs
deleted file mode 100644
index c1cc023..0000000
--- a/WF_EF_Api/StubbedContextLib/Migrations/20250402113707_pm_api.Designer.cs
+++ /dev/null
@@ -1,1074 +0,0 @@
-//
-using System;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using StubbedContextLib;
-
-#nullable disable
-
-namespace StubbedContextLib.Migrations
-{
- [DbContext(typeof(StubWTFContext))]
- [Migration("20250402113707_pm_api")]
- partial class pm_api
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "9.0.3")
- .HasAnnotation("Relational:MaxIdentifierLength", 128);
-
- SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
-
- modelBuilder.Entity("Entity.Admin", b =>
- {
- b.Property("IdUsers")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("IdUsers"));
-
- b.Property("UserId")
- .HasColumnType("int");
-
- b.HasKey("IdUsers");
-
- b.HasIndex("UserId");
-
- b.ToTable("admins");
- });
-
- modelBuilder.Entity("Entity.Character", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
-
- b.Property("IdImage")
- .HasColumnType("int");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
-
- b.HasKey("Id");
-
- b.HasIndex("IdImage");
-
- b.ToTable("characters");
-
- b.HasData(
- new
- {
- Id = 1,
- IdImage = 1,
- Name = "Alan Grant"
- },
- new
- {
- Id = 2,
- IdImage = 2,
- Name = "Aragorn"
- },
- new
- {
- Id = 3,
- IdImage = 3,
- Name = "Legolas"
- },
- new
- {
- Id = 4,
- IdImage = 4,
- Name = "Frodon"
- },
- new
- {
- Id = 5,
- IdImage = 5,
- Name = "Dobby"
- },
- new
- {
- Id = 6,
- IdImage = 6,
- Name = "Jon Snow"
- },
- new
- {
- Id = 7,
- IdImage = 7,
- Name = "Daenerys Targaryen"
- },
- new
- {
- Id = 8,
- IdImage = 8,
- Name = "Luke Skywalker"
- },
- new
- {
- Id = 9,
- IdImage = 9,
- Name = "Princess Leia"
- },
- new
- {
- Id = 10,
- IdImage = 10,
- Name = "Harry Potter"
- });
- });
-
- modelBuilder.Entity("Entity.Commentary", b =>
- {
- b.Property("IdUser")
- .HasColumnType("int");
-
- b.Property("IdQuote")
- .HasColumnType("int");
-
- b.Property("Comment")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("nvarchar(100)");
-
- b.Property("DateCommentary")
- .HasColumnType("date")
- .HasColumnName("DateCommentary");
-
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
-
- b.HasKey("IdUser", "IdQuote");
-
- b.HasIndex("IdQuote");
-
- b.ToTable("comments");
-
- b.HasData(
- new
- {
- IdUser = 2,
- IdQuote = 1,
- Comment = "Ce film est le meilleur",
- DateCommentary = new DateTime(2025, 2, 3, 0, 0, 0, 0, DateTimeKind.Unspecified),
- Id = 1
- },
- new
- {
- IdUser = 3,
- IdQuote = 1,
- Comment = "Very good",
- DateCommentary = new DateTime(2025, 3, 11, 0, 0, 0, 0, DateTimeKind.Unspecified),
- Id = 2
- });
- });
-
- modelBuilder.Entity("Entity.Favorite", b =>
- {
- b.Property("IdQuote")
- .HasColumnType("int");
-
- b.Property("IdUsers")
- .HasColumnType("int");
-
- b.HasKey("IdQuote", "IdUsers");
-
- b.HasIndex("IdUsers");
-
- b.ToTable("favorites");
-
- b.HasData(
- new
- {
- IdQuote = 2,
- IdUsers = 8
- },
- new
- {
- IdQuote = 5,
- IdUsers = 3
- },
- new
- {
- IdQuote = 9,
- IdUsers = 1
- },
- new
- {
- IdQuote = 4,
- IdUsers = 10
- },
- new
- {
- IdQuote = 3,
- IdUsers = 2
- },
- new
- {
- IdQuote = 6,
- IdUsers = 7
- },
- new
- {
- IdQuote = 1,
- IdUsers = 6
- },
- new
- {
- IdQuote = 8,
- IdUsers = 9
- },
- new
- {
- IdQuote = 10,
- IdUsers = 5
- });
- });
-
- modelBuilder.Entity("Entity.Images", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
-
- b.Property("ImgPath")
- .IsRequired()
- .HasColumnType("nvarchar(max)");
-
- b.HasKey("Id");
-
- b.ToTable("images");
-
- b.HasData(
- new
- {
- Id = 1,
- ImgPath = "https://th.bing.com/th/id/OIP.TJuWNCsibz8MVmhdNQEdMwHaE8?w=244&h=180&c=7&r=0&o=5&pid=1.7"
- },
- new
- {
- Id = 2,
- ImgPath = "https://th.bing.com/th/id/OIP.NgXRQ5-IknA6_qOPFhLWIwHaHK?w=165&h=180&c=7&r=0&o=5&pid=1.7"
- },
- new
- {
- Id = 3,
- ImgPath = "https://th.bing.com/th/id/OIP.XcJoJ6bC9sAMjol1pJn5UQHaLH?w=118&h=180&c=7&r=0&o=5&pid=1.7"
- },
- new
- {
- Id = 4,
- ImgPath = "https://th.bing.com/th/id/OIP.PPIESqZaNDa-qUcfSDXhdQHaGK?w=210&h=180&c=7&r=0&o=5&pid=1.7"
- },
- new
- {
- Id = 5,
- ImgPath = "https://th.bing.com/th/id/OIP.XBghSl2kfRNNtQoSxc901wHaHa?w=177&h=180&c=7&r=0&o=5&pid=1.7"
- },
- new
- {
- Id = 6,
- ImgPath = "https://th.bing.com/th/id/OIP.af1Aid64cqEKoIOBgCPxtQHaJO?w=145&h=182&c=7&r=0&o=5&pid=1.7"
- },
- new
- {
- Id = 7,
- ImgPath = "https://th.bing.com/th/id/OIP.ri5vSXr5lNTLt4DO6KQXyQHaI4?w=158&h=189&c=7&r=0&o=5&pid=1.7"
- },
- new
- {
- Id = 8,
- ImgPath = "https://th.bing.com/th/id/OIP.uPTRLR8uspCiafiunUqKfQHaMJ?w=115&h=180&c=7&r=0&o=5&pid=1.7"
- },
- new
- {
- Id = 9,
- ImgPath = "https://th.bing.com/th/id/OIP.hcJis4rKbyQtugsoFJU2ngHaM_?w=118&h=207&c=7&r=0&o=5&pid=1.7"
- },
- new
- {
- Id = 10,
- ImgPath = "https://th.bing.com/th/id/OIP.Py1_XfUrKJY_A6tYEmFS5wHaE8?w=280&h=187&c=7&r=0&o=5&pid=1.7"
- });
- });
-
- modelBuilder.Entity("Entity.Question", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
-
- b.Property("AnswerA")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
-
- b.Property("AnswerB")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
-
- b.Property("AnswerC")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
-
- b.Property("AnswerD")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
-
- b.Property("CorrectAnswer")
- .IsRequired()
- .HasMaxLength(1)
- .HasColumnType("nvarchar(1)");
-
- b.Property("IsValid")
- .HasColumnType("bit");
-
- b.Property("Text")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.HasKey("Id");
-
- b.ToTable("question");
-
- b.HasData(
- new
- {
- Id = 1,
- AnswerA = "Gimli",
- AnswerB = "Aragorn",
- AnswerC = "Frodon",
- AnswerD = "Gandalf",
- CorrectAnswer = "B",
- IsValid = true,
- Text = "Qui est le leader de la Communauté de l'Anneau ?"
- },
- new
- {
- Id = 2,
- AnswerA = "Serdaigle",
- AnswerB = "Gryffondor",
- AnswerC = "Serpentard",
- AnswerD = "Poufsouffle",
- CorrectAnswer = "B",
- IsValid = false,
- Text = "Dans quelle maison Harry Potter est-il ?"
- },
- new
- {
- Id = 3,
- AnswerA = "Saroumane",
- AnswerB = "Sauron",
- AnswerC = "Gollum",
- AnswerD = "Gothmog",
- CorrectAnswer = "B",
- IsValid = true,
- Text = "Qui est le Seigneur des Ténèbres dans la saga Le Seigneur des Anneaux ?"
- },
- new
- {
- Id = 4,
- AnswerA = "Han Solo",
- AnswerB = "Princesse Leia",
- AnswerC = "Chewbacca",
- AnswerD = "R2-D2",
- CorrectAnswer = "A",
- IsValid = true,
- Text = "Dans le film Star Wars : Episode IV, qui sauve Luke Skywalker de l'Étoile de la Mort ?"
- },
- new
- {
- Id = 5,
- AnswerA = "Reine Jadis",
- AnswerB = "Aslan",
- AnswerC = "Edmund",
- AnswerD = "Lucy",
- CorrectAnswer = "B",
- IsValid = true,
- Text = "Qui est le souverain de Narnia dans Le Lion, la Sorcière Blanche et l'Armoire Magique ?"
- },
- new
- {
- Id = 6,
- AnswerA = "Smaug",
- AnswerB = "Falkor",
- AnswerC = "Norbert",
- AnswerD = "Shenron",
- CorrectAnswer = "A",
- IsValid = true,
- Text = "Quel est le nom du dragon dans Le Hobbit ?"
- },
- new
- {
- Id = 7,
- AnswerA = "Bella Swan",
- AnswerB = "Edward Cullen",
- AnswerC = "Jacob Black",
- AnswerD = "Victoria",
- CorrectAnswer = "A",
- IsValid = true,
- Text = "Qui est la première personne à être mordue par un vampire dans Twilight ?"
- },
- new
- {
- Id = 8,
- AnswerA = "Obi-Wan Kenobi",
- AnswerB = "Yoda",
- AnswerC = "Han Solo",
- AnswerD = "Luke Skywalker",
- CorrectAnswer = "A",
- IsValid = true,
- Text = "Quel personnage dit Que la Force soit avec toi dans Star Wars ?"
- },
- new
- {
- Id = 9,
- AnswerA = "Dr. Ellie Sattler",
- AnswerB = "Alan Grant",
- AnswerC = "John Hammond",
- AnswerD = "Dennis Nedry",
- CorrectAnswer = "B",
- IsValid = true,
- Text = "Dans Jurassic Park, quel est le nom du paléontologue sur l'île ?"
- },
- new
- {
- Id = 10,
- AnswerA = "Cersei Lannister",
- AnswerB = "Arya Stark",
- AnswerC = "Daenerys Targaryen",
- AnswerD = "Sansa Stark",
- CorrectAnswer = "C",
- IsValid = true,
- Text = "Dans Game of Thrones, qui est surnommée la Mère des Dragons ?"
- });
- });
-
- modelBuilder.Entity("Entity.Quiz", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
-
- b.Property("IdImage")
- .HasColumnType("int");
-
- b.Property("NbQuestion")
- .HasColumnType("int");
-
- b.Property("Title")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
-
- b.HasKey("Id");
-
- b.HasIndex("IdImage");
-
- b.ToTable("quizzes");
-
- b.HasData(
- new
- {
- Id = 1,
- IdImage = 1,
- NbQuestion = 5,
- Title = "Quiz 1"
- },
- new
- {
- Id = 2,
- IdImage = 2,
- NbQuestion = 5,
- Title = "Quiz 2"
- });
- });
-
- modelBuilder.Entity("Entity.QuizQuestion", b =>
- {
- b.Property("IdQuestion")
- .HasColumnType("int");
-
- b.Property("IdQuiz")
- .HasColumnType("int");
-
- b.HasKey("IdQuestion", "IdQuiz");
-
- b.HasIndex("IdQuiz");
-
- b.ToTable("QuizQuestion");
-
- b.HasData(
- new
- {
- IdQuestion = 1,
- IdQuiz = 1
- },
- new
- {
- IdQuestion = 2,
- IdQuiz = 1
- },
- new
- {
- IdQuestion = 3,
- IdQuiz = 1
- },
- new
- {
- IdQuestion = 4,
- IdQuiz = 1
- },
- new
- {
- IdQuestion = 5,
- IdQuiz = 1
- },
- new
- {
- IdQuestion = 6,
- IdQuiz = 2
- },
- new
- {
- IdQuestion = 7,
- IdQuiz = 2
- },
- new
- {
- IdQuestion = 8,
- IdQuiz = 2
- },
- new
- {
- IdQuestion = 9,
- IdQuiz = 2
- },
- new
- {
- IdQuestion = 10,
- IdQuiz = 2
- });
- });
-
- modelBuilder.Entity("Entity.Quote", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
-
- b.Property("Content")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("nvarchar(100)");
-
- b.Property("IdCharacter")
- .HasColumnType("int");
-
- b.Property("IdSource")
- .HasColumnType("int");
-
- b.Property("IdUsersPropose")
- .HasColumnType("int");
-
- b.Property("IsValid")
- .HasColumnType("bit");
-
- b.Property("Langage")
- .HasColumnType("int");
-
- b.Property("Likes")
- .HasColumnType("int");
-
- b.HasKey("Id");
-
- b.HasIndex("IdCharacter");
-
- b.HasIndex("IdSource");
-
- b.HasIndex("IdUsersPropose");
-
- b.ToTable("quotes");
-
- b.HasData(
- new
- {
- Id = 1,
- Content = "Je n'y crois pas. Je n'y crois pas. Ce n'est pas possible",
- IdCharacter = 1,
- IdSource = 1,
- IdUsersPropose = 1,
- IsValid = true,
- Langage = 1,
- Likes = 11025
- },
- new
- {
- Id = 2,
- Content = "There is always hope",
- IdCharacter = 2,
- IdSource = 2,
- IdUsersPropose = 1,
- IsValid = true,
- Langage = 0,
- Likes = 11025
- },
- new
- {
- Id = 3,
- Content = "A red sun rises. Blood has been spilled this night.",
- IdCharacter = 3,
- IdSource = 2,
- IdUsersPropose = 1,
- IsValid = true,
- Langage = 0,
- Likes = 11025
- },
- new
- {
- Id = 4,
- Content = "I wish the Ring had never come to me.I wish none of this had happened.",
- IdCharacter = 4,
- IdSource = 2,
- IdUsersPropose = 1,
- IsValid = true,
- Langage = 0,
- Likes = 11025
- },
- new
- {
- Id = 5,
- Content = "Dobby is a free elf!",
- IdCharacter = 5,
- IdSource = 4,
- IdUsersPropose = 1,
- IsValid = true,
- Langage = 0,
- Likes = 11025
- },
- new
- {
- Id = 6,
- Content = "Winter is comming",
- IdCharacter = 6,
- IdSource = 3,
- IdUsersPropose = 1,
- IsValid = true,
- Langage = 0,
- Likes = 11025
- },
- new
- {
- Id = 7,
- Content = "Je suis la dernière Targaryen. Je suis la reine des dragons",
- IdCharacter = 7,
- IdSource = 3,
- IdUsersPropose = 1,
- IsValid = true,
- Langage = 1,
- Likes = 11025
- },
- new
- {
- Id = 8,
- Content = "Je ne suis pas prêt à affronter ça. C'est trop pour moi.",
- IdCharacter = 8,
- IdSource = 5,
- IdUsersPropose = 1,
- IsValid = true,
- Langage = 1,
- Likes = 11025
- },
- new
- {
- Id = 9,
- Content = "Aidez-moi, Obi-Wan Kenobi, vous êtes mon seul espoir.",
- IdCharacter = 9,
- IdSource = 5,
- IdUsersPropose = 1,
- IsValid = true,
- Langage = 1,
- Likes = 11025
- },
- new
- {
- Id = 10,
- Content = "La quoi ?",
- IdCharacter = 10,
- IdSource = 4,
- IdUsersPropose = 1,
- IsValid = false,
- Langage = 1,
- Likes = 11025
- });
- });
-
- modelBuilder.Entity("Entity.Source", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
-
- b.Property("Title")
- .IsRequired()
- .HasMaxLength(100)
- .HasColumnType("nvarchar(100)");
-
- b.Property("TypeSrc")
- .HasColumnType("int");
-
- b.Property("Year")
- .HasColumnType("int");
-
- b.HasKey("Id");
-
- b.ToTable("sources");
-
- b.HasData(
- new
- {
- Id = 1,
- Title = "Jurassic Park",
- TypeSrc = 0,
- Year = 1993
- },
- new
- {
- Id = 2,
- Title = "Le Seigneur des anneaux : La Communauté de l'anneau",
- TypeSrc = 0,
- Year = 2001
- },
- new
- {
- Id = 3,
- Title = "Game of throne",
- TypeSrc = 1,
- Year = 2011
- },
- new
- {
- Id = 4,
- Title = "Harry Potter à l'école des sorcier",
- TypeSrc = 0,
- Year = 1997
- },
- new
- {
- Id = 5,
- Title = "Star Wars, épisode IV : Un nouvel espoir",
- TypeSrc = 0,
- Year = 1977
- });
- });
-
- modelBuilder.Entity("Entity.Users", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
-
- b.Property("Created")
- .HasColumnType("date")
- .HasColumnName("Created");
-
- b.Property("Email")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
-
- b.Property("IdImage")
- .HasColumnType("int");
-
- b.Property("Password")
- .IsRequired()
- .HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
-
- b.Property("UserName")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
-
- b.HasKey("Id");
-
- b.HasIndex("IdImage");
-
- b.ToTable("users");
-
- b.HasData(
- new
- {
- Id = 1,
- Created = new DateTime(2025, 5, 12, 0, 0, 0, 0, DateTimeKind.Unspecified),
- Email = "jhonDhoe@gmail.com",
- IdImage = 1,
- Password = "1234",
- UserName = "Jhon-Dhoe"
- },
- new
- {
- Id = 2,
- Created = new DateTime(2025, 3, 19, 0, 0, 0, 0, DateTimeKind.Unspecified),
- Email = "lucy_rose@outlook.com",
- IdImage = 2,
- Password = "abcd",
- UserName = "Lucy-Rose"
- },
- new
- {
- Id = 3,
- Created = new DateTime(2024, 11, 2, 0, 0, 0, 0, DateTimeKind.Unspecified),
- Email = "mark.taylor@yahoo.com",
- IdImage = 3,
- Password = "5678",
- UserName = "Mark-Taylor"
- },
- new
- {
- Id = 4,
- Created = new DateTime(2025, 2, 28, 0, 0, 0, 0, DateTimeKind.Unspecified),
- Email = "sophie.martin@gmail.com",
- IdImage = 4,
- Password = "4321",
- UserName = "Sophie-Martin"
- },
- new
- {
- Id = 5,
- Created = new DateTime(2025, 1, 15, 0, 0, 0, 0, DateTimeKind.Unspecified),
- Email = "nathan_doe@aol.com",
- IdImage = 5,
- Password = "8765",
- UserName = "Nathan-Doe"
- },
- new
- {
- Id = 6,
- Created = new DateTime(2025, 4, 7, 0, 0, 0, 0, DateTimeKind.Unspecified),
- Email = "ella.brown@icloud.com",
- IdImage = 6,
- Password = "2468",
- UserName = "Ella-Brown"
- },
- new
- {
- Id = 7,
- Created = new DateTime(2024, 12, 25, 0, 0, 0, 0, DateTimeKind.Unspecified),
- Email = "oliver_smith@gmail.com",
- IdImage = 7,
- Password = "1357",
- UserName = "Oliver-Smith"
- },
- new
- {
- Id = 8,
- Created = new DateTime(2025, 3, 5, 0, 0, 0, 0, DateTimeKind.Unspecified),
- Email = "mia.jones@outlook.com",
- IdImage = 8,
- Password = "1122",
- UserName = "Mia-Jones"
- },
- new
- {
- Id = 9,
- Created = new DateTime(2025, 2, 22, 0, 0, 0, 0, DateTimeKind.Unspecified),
- Email = "kevin_williams@aol.com",
- IdImage = 9,
- Password = "2233",
- UserName = "Kevin-Williams"
- },
- new
- {
- Id = 10,
- Created = new DateTime(2025, 1, 3, 0, 0, 0, 0, DateTimeKind.Unspecified),
- Email = "olivia.white@yahoo.com",
- IdImage = 10,
- Password = "3344",
- UserName = "Olivia-White"
- });
- });
-
- modelBuilder.Entity("Entity.Admin", b =>
- {
- b.HasOne("Entity.Users", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("Entity.Character", b =>
- {
- b.HasOne("Entity.Images", "Images")
- .WithMany("Characters")
- .HasForeignKey("IdImage")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Images");
- });
-
- modelBuilder.Entity("Entity.Commentary", b =>
- {
- b.HasOne("Entity.Quote", "Quote")
- .WithMany("Commentarys")
- .HasForeignKey("IdQuote")
- .OnDelete(DeleteBehavior.ClientCascade)
- .IsRequired();
-
- b.HasOne("Entity.Users", "User")
- .WithMany()
- .HasForeignKey("IdUser")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Quote");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("Entity.Favorite", b =>
- {
- b.HasOne("Entity.Quote", "Quote")
- .WithMany()
- .HasForeignKey("IdQuote")
- .OnDelete(DeleteBehavior.ClientCascade)
- .IsRequired();
-
- b.HasOne("Entity.Users", "Users")
- .WithMany()
- .HasForeignKey("IdUsers")
- .OnDelete(DeleteBehavior.ClientCascade)
- .IsRequired();
-
- b.Navigation("Quote");
-
- b.Navigation("Users");
- });
-
- modelBuilder.Entity("Entity.Quiz", b =>
- {
- b.HasOne("Entity.Images", "Images")
- .WithMany("Quizs")
- .HasForeignKey("IdImage")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Images");
- });
-
- modelBuilder.Entity("Entity.QuizQuestion", b =>
- {
- b.HasOne("Entity.Question", null)
- .WithMany()
- .HasForeignKey("IdQuestion")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Entity.Quiz", null)
- .WithMany()
- .HasForeignKey("IdQuiz")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Entity.Quote", b =>
- {
- b.HasOne("Entity.Character", "Character")
- .WithMany("Quotes")
- .HasForeignKey("IdCharacter")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Entity.Source", "Source")
- .WithMany("Quotes")
- .HasForeignKey("IdSource")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Entity.Users", "User")
- .WithMany("Quotes")
- .HasForeignKey("IdUsersPropose");
-
- b.Navigation("Character");
-
- b.Navigation("Source");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("Entity.Users", b =>
- {
- b.HasOne("Entity.Images", "Images")
- .WithMany("Users")
- .HasForeignKey("IdImage")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Images");
- });
-
- modelBuilder.Entity("Entity.Character", b =>
- {
- b.Navigation("Quotes");
- });
-
- modelBuilder.Entity("Entity.Images", b =>
- {
- b.Navigation("Characters");
-
- b.Navigation("Quizs");
-
- b.Navigation("Users");
- });
-
- modelBuilder.Entity("Entity.Quote", b =>
- {
- b.Navigation("Commentarys");
- });
-
- modelBuilder.Entity("Entity.Source", b =>
- {
- b.Navigation("Quotes");
- });
-
- modelBuilder.Entity("Entity.Users", b =>
- {
- b.Navigation("Quotes");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/WF_EF_Api/StubbedContextLib/Migrations/20250402134601_pm_apiV2.cs b/WF_EF_Api/StubbedContextLib/Migrations/20250402134601_pm_apiV2.cs
deleted file mode 100644
index ec12b89..0000000
--- a/WF_EF_Api/StubbedContextLib/Migrations/20250402134601_pm_apiV2.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
-
-namespace StubbedContextLib.Migrations
-{
- ///
- public partial class pm_apiV2 : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropPrimaryKey(
- name: "PK_comments",
- table: "comments");
-
- migrationBuilder.DeleteData(
- table: "comments",
- keyColumns: new[] { "IdQuote", "IdUser" },
- keyValues: new object[] { 1, 2 });
-
- migrationBuilder.DeleteData(
- table: "comments",
- keyColumns: new[] { "IdQuote", "IdUser" },
- keyValues: new object[] { 1, 3 });
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_comments",
- table: "comments",
- column: "Id");
-
- migrationBuilder.InsertData(
- table: "comments",
- columns: new[] { "Id", "Comment", "DateCommentary", "IdQuote", "IdUser" },
- values: new object[,]
- {
- { 1, "Ce film est le meilleur", new DateTime(2025, 2, 3, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, 2 },
- { 2, "Very good", new DateTime(2025, 3, 11, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, 3 }
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_comments_IdUser",
- table: "comments",
- column: "IdUser");
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropPrimaryKey(
- name: "PK_comments",
- table: "comments");
-
- migrationBuilder.DropIndex(
- name: "IX_comments_IdUser",
- table: "comments");
-
- migrationBuilder.DeleteData(
- table: "comments",
- keyColumn: "Id",
- keyValue: 1);
-
- migrationBuilder.DeleteData(
- table: "comments",
- keyColumn: "Id",
- keyValue: 2);
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_comments",
- table: "comments",
- columns: new[] { "IdUser", "IdQuote" });
-
- migrationBuilder.InsertData(
- table: "comments",
- columns: new[] { "IdQuote", "IdUser", "Comment", "DateCommentary", "Id" },
- values: new object[,]
- {
- { 1, 2, "Ce film est le meilleur", new DateTime(2025, 2, 3, 0, 0, 0, 0, DateTimeKind.Unspecified), 1 },
- { 1, 3, "Very good", new DateTime(2025, 3, 11, 0, 0, 0, 0, DateTimeKind.Unspecified), 2 }
- });
- }
- }
-}
diff --git a/WF_EF_Api/StubbedContextLib/Migrations/20250402134601_pm_apiV2.Designer.cs b/WF_EF_Api/StubbedContextLib/Migrations/20250403144039_myFirstMigration.Designer.cs
similarity index 89%
rename from WF_EF_Api/StubbedContextLib/Migrations/20250402134601_pm_apiV2.Designer.cs
rename to WF_EF_Api/StubbedContextLib/Migrations/20250403144039_myFirstMigration.Designer.cs
index efad120..c7a9f09 100644
--- a/WF_EF_Api/StubbedContextLib/Migrations/20250402134601_pm_apiV2.Designer.cs
+++ b/WF_EF_Api/StubbedContextLib/Migrations/20250403144039_myFirstMigration.Designer.cs
@@ -2,7 +2,6 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using StubbedContextLib;
@@ -12,29 +11,23 @@ using StubbedContextLib;
namespace StubbedContextLib.Migrations
{
[DbContext(typeof(StubWTFContext))]
- [Migration("20250402134601_pm_apiV2")]
- partial class pm_apiV2
+ [Migration("20250403144039_myFirstMigration")]
+ partial class myFirstMigration
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "9.0.3")
- .HasAnnotation("Relational:MaxIdentifierLength", 128);
-
- SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+ modelBuilder.HasAnnotation("ProductVersion", "9.0.3");
modelBuilder.Entity("Entity.Admin", b =>
{
b.Property("IdUsers")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("IdUsers"));
+ .HasColumnType("INTEGER");
b.Property("UserId")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.HasKey("IdUsers");
@@ -47,17 +40,15 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("IdImage")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("Name")
.IsRequired()
.HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
+ .HasColumnType("TEXT");
b.HasKey("Id");
@@ -132,24 +123,22 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("Comment")
.IsRequired()
.HasMaxLength(100)
- .HasColumnType("nvarchar(100)");
+ .HasColumnType("TEXT");
b.Property("DateCommentary")
.HasColumnType("date")
.HasColumnName("DateCommentary");
b.Property("IdQuote")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("IdUser")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.HasKey("Id");
@@ -181,10 +170,10 @@ namespace StubbedContextLib.Migrations
modelBuilder.Entity("Entity.Favorite", b =>
{
b.Property("IdQuote")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("IdUsers")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.HasKey("IdQuote", "IdUsers");
@@ -244,13 +233,11 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("ImgPath")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasColumnType("TEXT");
b.HasKey("Id");
@@ -313,42 +300,40 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("AnswerA")
.IsRequired()
.HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
+ .HasColumnType("TEXT");
b.Property("AnswerB")
.IsRequired()
.HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
+ .HasColumnType("TEXT");
b.Property("AnswerC")
.IsRequired()
.HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
+ .HasColumnType("TEXT");
b.Property("AnswerD")
.IsRequired()
.HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
+ .HasColumnType("TEXT");
b.Property("CorrectAnswer")
.IsRequired()
.HasMaxLength(1)
- .HasColumnType("nvarchar(1)");
+ .HasColumnType("TEXT");
b.Property("IsValid")
- .HasColumnType("bit");
+ .HasColumnType("INTEGER");
b.Property("Text")
.IsRequired()
.HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
+ .HasColumnType("TEXT");
b.HasKey("Id");
@@ -471,20 +456,18 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("IdImage")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("NbQuestion")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("Title")
.IsRequired()
.HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
+ .HasColumnType("TEXT");
b.HasKey("Id");
@@ -512,10 +495,10 @@ namespace StubbedContextLib.Migrations
modelBuilder.Entity("Entity.QuizQuestion", b =>
{
b.Property("IdQuestion")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("IdQuiz")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.HasKey("IdQuestion", "IdQuiz");
@@ -580,32 +563,30 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("Content")
.IsRequired()
.HasMaxLength(100)
- .HasColumnType("nvarchar(100)");
+ .HasColumnType("TEXT");
b.Property("IdCharacter")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("IdSource")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("IdUsersPropose")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("IsValid")
- .HasColumnType("bit");
+ .HasColumnType("INTEGER");
b.Property("Langage")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("Likes")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.HasKey("Id");
@@ -734,20 +715,18 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("Title")
.IsRequired()
.HasMaxLength(100)
- .HasColumnType("nvarchar(100)");
+ .HasColumnType("TEXT");
b.Property("TypeSrc")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("Year")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.HasKey("Id");
@@ -795,9 +774,7 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("Created")
.HasColumnType("date")
@@ -806,20 +783,20 @@ namespace StubbedContextLib.Migrations
b.Property("Email")
.IsRequired()
.HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
+ .HasColumnType("TEXT");
b.Property("IdImage")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("Password")
.IsRequired()
.HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
+ .HasColumnType("TEXT");
b.Property("UserName")
.IsRequired()
.HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
+ .HasColumnType("TEXT");
b.HasKey("Id");
diff --git a/WF_EF_Api/StubbedContextLib/Migrations/20250402113707_pm_api.cs b/WF_EF_Api/StubbedContextLib/Migrations/20250403144039_myFirstMigration.cs
similarity index 78%
rename from WF_EF_Api/StubbedContextLib/Migrations/20250402113707_pm_api.cs
rename to WF_EF_Api/StubbedContextLib/Migrations/20250403144039_myFirstMigration.cs
index f9dd7c8..f434e1d 100644
--- a/WF_EF_Api/StubbedContextLib/Migrations/20250402113707_pm_api.cs
+++ b/WF_EF_Api/StubbedContextLib/Migrations/20250403144039_myFirstMigration.cs
@@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace StubbedContextLib.Migrations
{
///
- public partial class pm_api : Migration
+ public partial class myFirstMigration : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
@@ -17,9 +17,9 @@ namespace StubbedContextLib.Migrations
name: "images",
columns: table => new
{
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- ImgPath = table.Column(type: "nvarchar(max)", nullable: false)
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ ImgPath = table.Column(type: "TEXT", nullable: false)
},
constraints: table =>
{
@@ -30,15 +30,15 @@ namespace StubbedContextLib.Migrations
name: "question",
columns: table => new
{
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Text = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
- AnswerA = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
- AnswerB = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
- AnswerC = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
- AnswerD = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
- CorrectAnswer = table.Column(type: "nvarchar(1)", maxLength: 1, nullable: false),
- IsValid = table.Column(type: "bit", nullable: false)
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Text = table.Column(type: "TEXT", maxLength: 200, nullable: false),
+ AnswerA = table.Column(type: "TEXT", maxLength: 50, nullable: false),
+ AnswerB = table.Column(type: "TEXT", maxLength: 50, nullable: false),
+ AnswerC = table.Column(type: "TEXT", maxLength: 50, nullable: false),
+ AnswerD = table.Column(type: "TEXT", maxLength: 50, nullable: false),
+ CorrectAnswer = table.Column(type: "TEXT", maxLength: 1, nullable: false),
+ IsValid = table.Column(type: "INTEGER", nullable: false)
},
constraints: table =>
{
@@ -49,11 +49,11 @@ namespace StubbedContextLib.Migrations
name: "sources",
columns: table => new
{
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Title = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
- Year = table.Column(type: "int", nullable: false),
- TypeSrc = table.Column(type: "int", nullable: false)
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Title = table.Column(type: "TEXT", maxLength: 100, nullable: false),
+ Year = table.Column(type: "INTEGER", nullable: false),
+ TypeSrc = table.Column(type: "INTEGER", nullable: false)
},
constraints: table =>
{
@@ -64,10 +64,10 @@ namespace StubbedContextLib.Migrations
name: "characters",
columns: table => new
{
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
- IdImage = table.Column(type: "int", nullable: false)
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Name = table.Column(type: "TEXT", maxLength: 50, nullable: false),
+ IdImage = table.Column(type: "INTEGER", nullable: false)
},
constraints: table =>
{
@@ -84,11 +84,11 @@ namespace StubbedContextLib.Migrations
name: "quizzes",
columns: table => new
{
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Title = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
- IdImage = table.Column(type: "int", nullable: false),
- NbQuestion = table.Column(type: "int", nullable: false)
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Title = table.Column(type: "TEXT", maxLength: 50, nullable: false),
+ IdImage = table.Column(type: "INTEGER", nullable: false),
+ NbQuestion = table.Column(type: "INTEGER", nullable: false)
},
constraints: table =>
{
@@ -105,12 +105,12 @@ namespace StubbedContextLib.Migrations
name: "users",
columns: table => new
{
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- UserName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
- Email = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
- Password = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false),
- IdImage = table.Column(type: "int", nullable: false),
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ UserName = table.Column(type: "TEXT", maxLength: 50, nullable: false),
+ Email = table.Column(type: "TEXT", maxLength: 50, nullable: false),
+ Password = table.Column(type: "TEXT", maxLength: 200, nullable: false),
+ IdImage = table.Column(type: "INTEGER", nullable: false),
Created = table.Column(type: "date", nullable: false)
},
constraints: table =>
@@ -128,8 +128,8 @@ namespace StubbedContextLib.Migrations
name: "QuizQuestion",
columns: table => new
{
- IdQuiz = table.Column(type: "int", nullable: false),
- IdQuestion = table.Column(type: "int", nullable: false)
+ IdQuiz = table.Column(type: "INTEGER", nullable: false),
+ IdQuestion = table.Column(type: "INTEGER", nullable: false)
},
constraints: table =>
{
@@ -152,9 +152,9 @@ namespace StubbedContextLib.Migrations
name: "admins",
columns: table => new
{
- IdUsers = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- UserId = table.Column(type: "int", nullable: false)
+ IdUsers = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ UserId = table.Column(type: "INTEGER", nullable: false)
},
constraints: table =>
{
@@ -171,15 +171,15 @@ namespace StubbedContextLib.Migrations
name: "quotes",
columns: table => new
{
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Content = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
- Likes = table.Column(type: "int", nullable: false),
- Langage = table.Column(type: "int", nullable: false),
- IsValid = table.Column(type: "bit", nullable: false),
- IdCharacter = table.Column(type: "int", nullable: false),
- IdSource = table.Column(type: "int", nullable: false),
- IdUsersPropose = table.Column(type: "int", nullable: true)
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Content = table.Column(type: "TEXT", maxLength: 100, nullable: false),
+ Likes = table.Column(type: "INTEGER", nullable: false),
+ Langage = table.Column(type: "INTEGER", nullable: false),
+ IsValid = table.Column(type: "INTEGER", nullable: false),
+ IdCharacter = table.Column(type: "INTEGER", nullable: false),
+ IdSource = table.Column(type: "INTEGER", nullable: false),
+ IdUsersPropose = table.Column(type: "INTEGER", nullable: true)
},
constraints: table =>
{
@@ -207,16 +207,16 @@ namespace StubbedContextLib.Migrations
name: "comments",
columns: table => new
{
- IdUser = table.Column(type: "int", nullable: false),
- IdQuote = table.Column(type: "int", nullable: false),
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ IdUser = table.Column(type: "INTEGER", nullable: false),
+ IdQuote = table.Column(type: "INTEGER", nullable: false),
DateCommentary = table.Column(type: "date", nullable: false),
- Comment = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false)
+ Comment = table.Column(type: "TEXT", maxLength: 100, nullable: false)
},
constraints: table =>
{
- table.PrimaryKey("PK_comments", x => new { x.IdUser, x.IdQuote });
+ table.PrimaryKey("PK_comments", x => x.Id);
table.ForeignKey(
name: "FK_comments_quotes_IdQuote",
column: x => x.IdQuote,
@@ -234,8 +234,8 @@ namespace StubbedContextLib.Migrations
name: "favorites",
columns: table => new
{
- IdUsers = table.Column(type: "int", nullable: false),
- IdQuote = table.Column(type: "int", nullable: false)
+ IdUsers = table.Column(type: "INTEGER", nullable: false),
+ IdQuote = table.Column(type: "INTEGER", nullable: false)
},
constraints: table =>
{
@@ -377,11 +377,11 @@ namespace StubbedContextLib.Migrations
migrationBuilder.InsertData(
table: "comments",
- columns: new[] { "IdQuote", "IdUser", "Comment", "DateCommentary", "Id" },
+ columns: new[] { "Id", "Comment", "DateCommentary", "IdQuote", "IdUser" },
values: new object[,]
{
- { 1, 2, "Ce film est le meilleur", new DateTime(2025, 2, 3, 0, 0, 0, 0, DateTimeKind.Unspecified), 1 },
- { 1, 3, "Very good", new DateTime(2025, 3, 11, 0, 0, 0, 0, DateTimeKind.Unspecified), 2 }
+ { 1, "Ce film est le meilleur", new DateTime(2025, 2, 3, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, 2 },
+ { 2, "Very good", new DateTime(2025, 3, 11, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, 3 }
});
migrationBuilder.InsertData(
@@ -415,6 +415,11 @@ namespace StubbedContextLib.Migrations
table: "comments",
column: "IdQuote");
+ migrationBuilder.CreateIndex(
+ name: "IX_comments_IdUser",
+ table: "comments",
+ column: "IdUser");
+
migrationBuilder.CreateIndex(
name: "IX_favorites_IdUsers",
table: "favorites",
diff --git a/WF_EF_Api/StubbedContextLib/Migrations/StubWTFContextModelSnapshot.cs b/WF_EF_Api/StubbedContextLib/Migrations/StubWTFContextModelSnapshot.cs
index 08ef8a9..e475fb9 100644
--- a/WF_EF_Api/StubbedContextLib/Migrations/StubWTFContextModelSnapshot.cs
+++ b/WF_EF_Api/StubbedContextLib/Migrations/StubWTFContextModelSnapshot.cs
@@ -2,7 +2,6 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using StubbedContextLib;
@@ -16,22 +15,16 @@ namespace StubbedContextLib.Migrations
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "9.0.3")
- .HasAnnotation("Relational:MaxIdentifierLength", 128);
-
- SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+ modelBuilder.HasAnnotation("ProductVersion", "9.0.3");
modelBuilder.Entity("Entity.Admin", b =>
{
b.Property("IdUsers")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("IdUsers"));
+ .HasColumnType("INTEGER");
b.Property("UserId")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.HasKey("IdUsers");
@@ -44,17 +37,15 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("IdImage")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("Name")
.IsRequired()
.HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
+ .HasColumnType("TEXT");
b.HasKey("Id");
@@ -129,24 +120,22 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("Comment")
.IsRequired()
.HasMaxLength(100)
- .HasColumnType("nvarchar(100)");
+ .HasColumnType("TEXT");
b.Property("DateCommentary")
.HasColumnType("date")
.HasColumnName("DateCommentary");
b.Property("IdQuote")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("IdUser")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.HasKey("Id");
@@ -178,10 +167,10 @@ namespace StubbedContextLib.Migrations
modelBuilder.Entity("Entity.Favorite", b =>
{
b.Property("IdQuote")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("IdUsers")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.HasKey("IdQuote", "IdUsers");
@@ -241,13 +230,11 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("ImgPath")
.IsRequired()
- .HasColumnType("nvarchar(max)");
+ .HasColumnType("TEXT");
b.HasKey("Id");
@@ -310,42 +297,40 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("AnswerA")
.IsRequired()
.HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
+ .HasColumnType("TEXT");
b.Property("AnswerB")
.IsRequired()
.HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
+ .HasColumnType("TEXT");
b.Property("AnswerC")
.IsRequired()
.HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
+ .HasColumnType("TEXT");
b.Property("AnswerD")
.IsRequired()
.HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
+ .HasColumnType("TEXT");
b.Property("CorrectAnswer")
.IsRequired()
.HasMaxLength(1)
- .HasColumnType("nvarchar(1)");
+ .HasColumnType("TEXT");
b.Property("IsValid")
- .HasColumnType("bit");
+ .HasColumnType("INTEGER");
b.Property("Text")
.IsRequired()
.HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
+ .HasColumnType("TEXT");
b.HasKey("Id");
@@ -468,20 +453,18 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("IdImage")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("NbQuestion")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("Title")
.IsRequired()
.HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
+ .HasColumnType("TEXT");
b.HasKey("Id");
@@ -509,10 +492,10 @@ namespace StubbedContextLib.Migrations
modelBuilder.Entity("Entity.QuizQuestion", b =>
{
b.Property("IdQuestion")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("IdQuiz")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.HasKey("IdQuestion", "IdQuiz");
@@ -577,32 +560,30 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("Content")
.IsRequired()
.HasMaxLength(100)
- .HasColumnType("nvarchar(100)");
+ .HasColumnType("TEXT");
b.Property("IdCharacter")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("IdSource")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("IdUsersPropose")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("IsValid")
- .HasColumnType("bit");
+ .HasColumnType("INTEGER");
b.Property("Langage")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("Likes")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.HasKey("Id");
@@ -731,20 +712,18 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("Title")
.IsRequired()
.HasMaxLength(100)
- .HasColumnType("nvarchar(100)");
+ .HasColumnType("TEXT");
b.Property("TypeSrc")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("Year")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.HasKey("Id");
@@ -792,9 +771,7 @@ namespace StubbedContextLib.Migrations
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+ .HasColumnType("INTEGER");
b.Property("Created")
.HasColumnType("date")
@@ -803,20 +780,20 @@ namespace StubbedContextLib.Migrations
b.Property("Email")
.IsRequired()
.HasMaxLength(50)
- .HasColumnType("nvarchar(50)");
+ .HasColumnType("TEXT");
b.Property("IdImage")
- .HasColumnType("int");
+ .HasColumnType("INTEGER");
b.Property("Password")
.IsRequired()
.HasMaxLength(200)
- .HasColumnType("nvarchar(200)");
+ .HasColumnType("TEXT");
b.Property