insert datas

This commit is contained in:
2026-03-10 08:35:40 +01:00
parent ecdabab5a1
commit 2e7b9e5154
185 changed files with 2361 additions and 1355 deletions

View File

@@ -17,7 +17,7 @@ namespace BookHive.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.20")
.HasAnnotation("ProductVersion", "10.0.3")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
@@ -55,6 +55,35 @@ namespace BookHive.Migrations
b.HasKey("Id");
b.ToTable("Authors");
b.HasData(
new
{
Id = 1,
Biography = "Auteur britannique connu pour ses romans dystopiques.",
BirthDate = new DateOnly(1903, 6, 25),
FirstName = "George",
LastName = "Orwell",
Nationality = "Britannique"
},
new
{
Id = 2,
Biography = "Romancière anglaise célèbre pour ses romans sur la société.",
BirthDate = new DateOnly(1775, 12, 16),
FirstName = "Jane",
LastName = "Austen",
Nationality = "Britannique"
},
new
{
Id = 3,
Biography = "Poète et écrivain français du XIXe siècle.",
BirthDate = new DateOnly(1802, 2, 26),
FirstName = "Victor",
LastName = "Hugo",
Nationality = "Française"
});
});
modelBuilder.Entity("BookHive.Models.Book", b =>
@@ -97,6 +126,74 @@ namespace BookHive.Migrations
b.HasIndex("AuthorId");
b.ToTable("Books");
b.HasData(
new
{
Id = 1,
AuthorId = 1,
Genre = "Dystopie",
Isbn = "9780451524935",
PageCount = 328,
PublishedDate = new DateOnly(1949, 6, 8),
Summary = "Roman dystopique sur un régime totalitaire.",
Title = "1984"
},
new
{
Id = 2,
AuthorId = 1,
Genre = "Satire",
Isbn = "9780451526342",
PageCount = 112,
PublishedDate = new DateOnly(1945, 8, 17),
Summary = "Satire politique sous forme de fable animale.",
Title = "Animal Farm"
},
new
{
Id = 3,
AuthorId = 2,
Genre = "Roman",
Isbn = "9780141439518",
PageCount = 279,
PublishedDate = new DateOnly(1813, 1, 28),
Summary = "Histoire romantique dans l'Angleterre du XIXe siècle.",
Title = "Pride and Prejudice"
},
new
{
Id = 4,
AuthorId = 2,
Genre = "Roman",
Isbn = "9780141439662",
PageCount = 226,
PublishedDate = new DateOnly(1811, 10, 30),
Summary = "Roman sur les sœurs Dashwood.",
Title = "Sense and Sensibility"
},
new
{
Id = 5,
AuthorId = 3,
Genre = "Roman historique",
Isbn = "9782070409189",
PageCount = 1463,
PublishedDate = new DateOnly(1862, 4, 3),
Summary = "Grande fresque sociale sur la misère et la justice.",
Title = "Les Misérables"
},
new
{
Id = 6,
AuthorId = 3,
Genre = "Roman historique",
Isbn = "9782253004226",
PageCount = 940,
PublishedDate = new DateOnly(1831, 1, 14),
Summary = "Roman historique se déroulant à Paris.",
Title = "Notre-Dame de Paris"
});
});
modelBuilder.Entity("BookHive.Models.Loan", b =>
@@ -129,6 +226,51 @@ namespace BookHive.Migrations
b.HasIndex("MemberId");
b.ToTable("Loans");
b.HasData(
new
{
Id = 1,
BookId = 1,
DueDate = new DateOnly(2025, 12, 15),
LoanDate = new DateOnly(2025, 12, 1),
MemberId = 1,
ReturnDate = new DateOnly(2025, 12, 10)
},
new
{
Id = 2,
BookId = 2,
DueDate = new DateOnly(2025, 12, 20),
LoanDate = new DateOnly(2025, 12, 5),
MemberId = 2,
ReturnDate = new DateOnly(2025, 12, 18)
},
new
{
Id = 3,
BookId = 3,
DueDate = new DateOnly(2025, 12, 25),
LoanDate = new DateOnly(2025, 12, 10),
MemberId = 3
},
new
{
Id = 4,
BookId = 4,
DueDate = new DateOnly(2025, 12, 27),
LoanDate = new DateOnly(2025, 12, 12),
MemberId = 1
},
new
{
Id = 5,
BookId = 5,
DueDate = new DateOnly(2025, 11, 15),
LoanDate = new DateOnly(2025, 11, 1),
MemberId = 2,
ReturnDate = new DateOnly(2025, 11, 14)
});
});
modelBuilder.Entity("BookHive.Models.Member", b =>
@@ -162,6 +304,44 @@ namespace BookHive.Migrations
b.HasKey("Id");
b.ToTable("Members");
b.HasData(
new
{
Id = 1,
Email = "alice@example.com",
FirstName = "Alice",
IsActive = true,
LastName = "Martin",
MembershipDate = new DateOnly(2023, 1, 10)
},
new
{
Id = 2,
Email = "bob@example.com",
FirstName = "Bob",
IsActive = true,
LastName = "Durand",
MembershipDate = new DateOnly(2023, 5, 12)
},
new
{
Id = 3,
Email = "claire@example.com",
FirstName = "Claire",
IsActive = true,
LastName = "Petit",
MembershipDate = new DateOnly(2024, 2, 2)
},
new
{
Id = 4,
Email = "david@example.com",
FirstName = "David",
IsActive = true,
LastName = "Bernard",
MembershipDate = new DateOnly(2024, 6, 15)
});
});
modelBuilder.Entity("BookHive.Models.Review", b =>
@@ -179,8 +359,7 @@ namespace BookHive.Migrations
.HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<DateTime?>("CreatedAt")
.IsRequired()
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<int>("MemberId")
@@ -197,6 +376,44 @@ namespace BookHive.Migrations
.IsUnique();
b.ToTable("Reviews");
b.HasData(
new
{
Id = 1,
BookId = 1,
Comment = "Un chef-d'œuvre dystopique.",
CreatedAt = new DateTime(2025, 12, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
MemberId = 1,
Rating = 5
},
new
{
Id = 2,
BookId = 3,
Comment = "Très bon roman classique.",
CreatedAt = new DateTime(2025, 12, 2, 0, 0, 0, 0, DateTimeKind.Unspecified),
MemberId = 2,
Rating = 4
},
new
{
Id = 3,
BookId = 5,
Comment = "Incroyable roman historique.",
CreatedAt = new DateTime(2025, 12, 3, 0, 0, 0, 0, DateTimeKind.Unspecified),
MemberId = 3,
Rating = 5
},
new
{
Id = 4,
BookId = 2,
Comment = "Drôle et intelligent.",
CreatedAt = new DateTime(2025, 12, 4, 0, 0, 0, 0, DateTimeKind.Unspecified),
MemberId = 4,
Rating = 4
});
});
modelBuilder.Entity("BookHive.Models.Book", b =>