Entity-Framework-DBZ/EntityFrameworkCore.Data/Migrations/20250404152141_InitialMigration.cs
Kevin Matsubara 5b3c661b67 Create initial migration.
deadballzone/EntityFrameworkCore.Console(master)$
dotnet ef migrations add InitialMigration --startup-project ./ --project ../EntityFrameworkCore.Data
2025-04-04 17:28:08 +02:00

54 lines
1.8 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EntityFrameworkCore.Data.Migrations
{
/// <inheritdoc />
public partial class InitialMigration : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Coaches",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
CreatedDate = table.Column<DateTime>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Coaches", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Teams",
columns: table => new
{
TeamId = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: true),
CreatedDate = table.Column<DateTime>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Teams", x => x.TeamId);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Coaches");
migrationBuilder.DropTable(
name: "Teams");
}
}
}