This commit is contained in:
328p
2026-11-27 15:09:02 +03:00
parent 56adf7e2bb
commit 56f644e08e
41 changed files with 4240 additions and 1 deletions
@@ -0,0 +1,43 @@
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace ConsoleApp1.Migrations
{
/// <inheritdoc />
public partial class initdx : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "pokemon",
columns: table => new
{
pokemon_id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
name = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
height = table.Column<double>(type: "double precision", nullable: false),
weight = table.Column<double>(type: "double precision", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_pokemon", x => x.pokemon_id);
});
migrationBuilder.CreateIndex(
name: "IX_pokemon_name",
table: "pokemon",
column: "name",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "pokemon");
}
}
}