add: ef core
This commit is contained in:
45
Migrations/20250903175616_InitialCreate.cs
Normal file
45
Migrations/20250903175616_InitialCreate.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Workshop10_API.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialCreate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Workshops",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
Title = table.Column<string>(type: "TEXT", maxLength: 120, nullable: false),
|
||||
Description = table.Column<string>(type: "TEXT", maxLength: 2000, nullable: true),
|
||||
StartAt = table.Column<DateTimeOffset>(type: "TEXT", nullable: false),
|
||||
EndAt = table.Column<DateTimeOffset>(type: "TEXT", nullable: false),
|
||||
Location = table.Column<string>(type: "TEXT", maxLength: 200, nullable: true),
|
||||
Capacity = table.Column<int>(type: "INTEGER", nullable: false, defaultValue: 1),
|
||||
IsOnline = table.Column<bool>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Workshops", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Workshops_StartAt",
|
||||
table: "Workshops",
|
||||
column: "StartAt");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Workshops");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user