diff options
author | HombreLaser <sebastian-440@live.com> | 2022-09-15 16:52:16 -0500 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2022-09-15 16:52:16 -0500 |
commit | 0bcbc7f4721830a1a65fbd2e30fbb69f803884c2 (patch) | |
tree | f1fb8bb0c51ea7851f57731a95a05b74d7f2bbc8 /Migrations/20220915213615_InitialCreate.cs | |
parent | 2ef25a3fad449f8a05491db4a46fc3990c27cf15 (diff) |
Añadir base de datos
Diffstat (limited to 'Migrations/20220915213615_InitialCreate.cs')
-rw-r--r-- | Migrations/20220915213615_InitialCreate.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Migrations/20220915213615_InitialCreate.cs b/Migrations/20220915213615_InitialCreate.cs new file mode 100644 index 0000000..ae3abe2 --- /dev/null +++ b/Migrations/20220915213615_InitialCreate.cs @@ -0,0 +1,36 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace LibraryAPI.Migrations +{ + public partial class InitialCreate : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Books", + columns: table => new + { + Id = table.Column<long>(type: "bigint", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + PublicationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), + Genres = table.Column<string[]>(type: "text[]", nullable: false), + Edition = table.Column<int>(type: "integer", nullable: false), + ISBN = table.Column<string>(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Books", x => x.Id); + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Books"); + } + } +} |