summaryrefslogtreecommitdiff
path: root/Migrations
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2022-09-15 18:06:05 -0500
committerHombreLaser <sebastian-440@live.com>2022-09-15 18:06:05 -0500
commit68b94929d44e1f4ffbee4cadc4c54cc438f6634c (patch)
tree486b652a52bd3e62f10ccb3a33af3b3a2b527c02 /Migrations
parentc314f2739fee287d24dd0c1cbf2994c17a0e3221 (diff)
Añadir atributo título a libro
Diffstat (limited to 'Migrations')
-rw-r--r--Migrations/20220915225908_AddBookTitle.Designer.cs60
-rw-r--r--Migrations/20220915225908_AddBookTitle.cs26
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");
+ }
+ }
+}