generated from admin/template
начал
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PokedexApi.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class PokemonTable : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "pokemon",
|
||||
columns: table => new
|
||||
{
|
||||
pokemon_id = table.Column<int>(type: "integer", nullable: false),
|
||||
pokemon_name = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
|
||||
pokemon_height_m = table.Column<double>(type: "double precision", nullable: false),
|
||||
pokemon_weight_kg = table.Column<double>(type: "double precision", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_pokemon", x => x.pokemon_id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_pokemon_pokemon_name",
|
||||
table: "pokemon",
|
||||
column: "pokemon_name",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "pokemon");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user