Files
sanstudent/Api/Database/Migrations/20260301222003_CreateDb.cs
aherman-san b8f03bf6d3
All checks were successful
SanStudent Multi-Project Deployment / deploy-api (push) Successful in 41s
SanStudent Multi-Project Deployment / deploy-frontadmin (push) Successful in 41s
SanStudent Multi-Project Deployment / deploy-frontstudent (push) Successful in 40s
Add project
2026-03-07 11:14:26 +01:00

45 lines
1.6 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Api.Database.Migrations
{
/// <inheritdoc />
public partial class CreateDb : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Students",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
FirstName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
LastName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
AlbumNumber = table.Column<string>(type: "nvarchar(6)", maxLength: 6, nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
LastModifiedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Students", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Students_AlbumNumber",
table: "Students",
column: "AlbumNumber",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Students");
}
}
}