From 2c9c2cc3b414115bca9b6c63ca7b20d49a8a8ec1 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Thu, 15 Sep 2022 20:55:44 -0500 Subject: Agregar autor --- Migrations/20220916003408_InitialMigration.cs | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Migrations/20220916003408_InitialMigration.cs (limited to 'Migrations/20220916003408_InitialMigration.cs') diff --git a/Migrations/20220916003408_InitialMigration.cs b/Migrations/20220916003408_InitialMigration.cs new file mode 100644 index 0000000..620f926 --- /dev/null +++ b/Migrations/20220916003408_InitialMigration.cs @@ -0,0 +1,36 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace LibraryAPI.Migrations +{ + public partial class InitialMigration : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Author", + columns: table => new + { + Id = table.Column(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Country = table.Column(type: "text", nullable: true), + Name = table.Column(type: "text", nullable: true), + YearOfBirth = table.Column(type: "integer", nullable: false), + languages = table.Column(type: "text[]", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Author", x => x.Id); + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Author"); + } + } +} -- cgit v1.2.3