diff options
Diffstat (limited to 'Migrations')
-rw-r--r-- | Migrations/20220915225908_AddBookTitle.Designer.cs | 60 | ||||
-rw-r--r-- | Migrations/20220915225908_AddBookTitle.cs | 26 |
2 files changed, 86 insertions, 0 deletions
diff --git a/Migrations/20220915225908_AddBookTitle.Designer.cs b/Migrations/20220915225908_AddBookTitle.Designer.cs new file mode 100644 index 0000000..1208102 --- /dev/null +++ b/Migrations/20220915225908_AddBookTitle.Designer.cs @@ -0,0 +1,60 @@ +// <auto-generated /> +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("20220915225908_AddBookTitle")] + partial class AddBookTitle + { + 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.Book", b => + { + b.Property<long>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id")); + + b.Property<int>("Edition") + .HasColumnType("integer"); + + b.Property<string[]>("Genres") + .IsRequired() + .HasColumnType("text[]"); + + b.Property<string>("ISBN") + .IsRequired() + .HasColumnType("text"); + + b.Property<DateTime>("PublicationDate") + .HasColumnType("timestamp with time zone"); + + b.Property<string>("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Books"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Migrations/20220915225908_AddBookTitle.cs b/Migrations/20220915225908_AddBookTitle.cs new file mode 100644 index 0000000..ef3f3a7 --- /dev/null +++ b/Migrations/20220915225908_AddBookTitle.cs @@ -0,0 +1,26 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace LibraryAPI.Migrations +{ + public partial class AddBookTitle : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn<string>( + name: "Title", + table: "Books", + type: "text", + nullable: false, + defaultValue: ""); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Title", + table: "Books"); + } + } +} |