summaryrefslogtreecommitdiff
path: root/Migrations/LibraryContextModelSnapshot.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Migrations/LibraryContextModelSnapshot.cs')
-rw-r--r--Migrations/LibraryContextModelSnapshot.cs94
1 files changed, 92 insertions, 2 deletions
diff --git a/Migrations/LibraryContextModelSnapshot.cs b/Migrations/LibraryContextModelSnapshot.cs
index 0fa3e9b..a523712 100644
--- a/Migrations/LibraryContextModelSnapshot.cs
+++ b/Migrations/LibraryContextModelSnapshot.cs
@@ -31,15 +31,19 @@ namespace LibraryAPI.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<string>("Country")
+ .IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
- .HasColumnType("text");
+ .IsRequired()
+ .HasMaxLength(64)
+ .HasColumnType("character varying(64)");
b.Property<int>("YearOfBirth")
.HasColumnType("integer");
b.Property<string[]>("languages")
+ .IsRequired()
.HasColumnType("text[]");
b.HasKey("Id");
@@ -62,16 +66,20 @@ namespace LibraryAPI.Migrations
.HasColumnType("integer");
b.Property<string[]>("Genres")
+ .IsRequired()
.HasColumnType("text[]");
b.Property<string>("ISBN")
+ .IsRequired()
.HasColumnType("text");
b.Property<int>("PublicationYear")
.HasColumnType("integer");
b.Property<string>("Title")
- .HasColumnType("text");
+ .IsRequired()
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
b.HasKey("Id");
@@ -80,6 +88,59 @@ namespace LibraryAPI.Migrations
b.ToTable("Books");
});
+ modelBuilder.Entity("LibraryAPI.Models.Group", b =>
+ {
+ b.Property<long>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
+
+ b.Property<string>("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("Groups");
+ });
+
+ modelBuilder.Entity("LibraryAPI.Models.GroupUserAccount", b =>
+ {
+ b.Property<long>("UserAccountId")
+ .HasColumnType("bigint");
+
+ b.Property<long>("GroupId")
+ .HasColumnType("bigint");
+
+ b.HasKey("UserAccountId", "GroupId");
+
+ b.HasIndex("GroupId");
+
+ b.ToTable("GroupUserAccounts");
+ });
+
+ modelBuilder.Entity("LibraryAPI.Models.UserAccount", b =>
+ {
+ b.Property<long>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
+
+ b.Property<string>("Email")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property<string>("Password")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("Users");
+ });
+
modelBuilder.Entity("LibraryAPI.Models.Book", b =>
{
b.HasOne("LibraryAPI.Models.Author", "Author")
@@ -91,10 +152,39 @@ namespace LibraryAPI.Migrations
b.Navigation("Author");
});
+ modelBuilder.Entity("LibraryAPI.Models.GroupUserAccount", b =>
+ {
+ b.HasOne("LibraryAPI.Models.Group", "Group")
+ .WithMany("Users")
+ .HasForeignKey("GroupId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("LibraryAPI.Models.UserAccount", "UserAccount")
+ .WithMany("Groups")
+ .HasForeignKey("UserAccountId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Group");
+
+ b.Navigation("UserAccount");
+ });
+
modelBuilder.Entity("LibraryAPI.Models.Author", b =>
{
b.Navigation("Books");
});
+
+ modelBuilder.Entity("LibraryAPI.Models.Group", b =>
+ {
+ b.Navigation("Users");
+ });
+
+ modelBuilder.Entity("LibraryAPI.Models.UserAccount", b =>
+ {
+ b.Navigation("Groups");
+ });
#pragma warning restore 612, 618
}
}