// using System; using LibraryAPI.Models; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace LibraryAPI.Migrations { [DbContext(typeof(LibraryContext))] [Migration("20220916003555_AddBookTable")] partial class AddBookTable { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "6.0.9") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("LibraryAPI.Models.Author", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Country") .HasColumnType("text"); b.Property("Name") .HasColumnType("text"); b.Property("YearOfBirth") .HasColumnType("integer"); b.Property("languages") .HasColumnType("text[]"); b.HasKey("Id"); b.ToTable("Author"); }); modelBuilder.Entity("LibraryAPI.Models.Book", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("AuthorId") .HasColumnType("bigint"); b.Property("Edition") .HasColumnType("integer"); b.Property("Genres") .HasColumnType("text[]"); b.Property("ISBN") .HasColumnType("text"); b.Property("PublicationYear") .HasColumnType("integer"); b.Property("Title") .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("AuthorId"); b.ToTable("Book"); }); 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 } } }