diff options
author | HombreLaser <sebastian-440@live.com> | 2022-11-06 02:10:44 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2022-11-06 02:10:44 -0600 |
commit | 08819c6738a4f82ccf07ae5ed60835b087f7bb34 (patch) | |
tree | 9c0c77626587136d41002769fb5a030e1be2f5b8 /Migrations/LibraryContextModelSnapshot.cs | |
parent | f060c4f88f635af3295ea7652cbbbd08dbf1c6cf (diff) |
Añadidos grupos y usuarios
Diffstat (limited to 'Migrations/LibraryContextModelSnapshot.cs')
-rw-r--r-- | Migrations/LibraryContextModelSnapshot.cs | 94 |
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 } } |