diff options
author | HombreLaser <sebastian-440@live.com> | 2022-09-15 20:55:44 -0500 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2022-09-15 20:55:44 -0500 |
commit | 2c9c2cc3b414115bca9b6c63ca7b20d49a8a8ec1 (patch) | |
tree | 0344372eca04eab992ece36c4e07511f6f0214c6 /Migrations/LibraryContextModelSnapshot.cs | |
parent | 3381c633fcd73e5159ae4a607835167ebdbb12ee (diff) |
Agregar autor
Diffstat (limited to 'Migrations/LibraryContextModelSnapshot.cs')
-rw-r--r-- | Migrations/LibraryContextModelSnapshot.cs | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/Migrations/LibraryContextModelSnapshot.cs b/Migrations/LibraryContextModelSnapshot.cs index d340ff6..0fa3e9b 100644 --- a/Migrations/LibraryContextModelSnapshot.cs +++ b/Migrations/LibraryContextModelSnapshot.cs @@ -22,6 +22,31 @@ namespace LibraryAPI.Migrations NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + modelBuilder.Entity("LibraryAPI.Models.Author", b => + { + b.Property<long>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id")); + + b.Property<string>("Country") + .HasColumnType("text"); + + b.Property<string>("Name") + .HasColumnType("text"); + + b.Property<int>("YearOfBirth") + .HasColumnType("integer"); + + b.Property<string[]>("languages") + .HasColumnType("text[]"); + + b.HasKey("Id"); + + b.ToTable("Authors"); + }); + modelBuilder.Entity("LibraryAPI.Models.Book", b => { b.Property<long>("Id") @@ -30,29 +55,46 @@ namespace LibraryAPI.Migrations NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id")); + b.Property<long>("AuthorId") + .HasColumnType("bigint"); + b.Property<int>("Edition") .HasColumnType("integer"); b.Property<string[]>("Genres") - .IsRequired() .HasColumnType("text[]"); b.Property<string>("ISBN") - .IsRequired() .HasColumnType("text"); b.Property<int>("PublicationYear") - .IsRequired() .HasColumnType("integer"); b.Property<string>("Title") - .IsRequired() .HasColumnType("text"); b.HasKey("Id"); + b.HasIndex("AuthorId"); + b.ToTable("Books"); }); + + modelBuilder.Entity("LibraryAPI.Models.Book", b => + { + b.HasOne("LibraryAPI.Models.Author", "Author") + .WithMany("Books") + .HasForeignKey("AuthorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + }); + + modelBuilder.Entity("LibraryAPI.Models.Author", b => + { + b.Navigation("Books"); + }); #pragma warning restore 612, 618 } } |