Files
sanstudent/Api/Database/Migrations/20260305195643_SpecsSubjectsAndSeasons.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

72 lines
2.6 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Api.Database.Migrations
{
/// <inheritdoc />
public partial class SpecsSubjectsAndSeasons : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Seasons",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
StartDate = table.Column<DateOnly>(type: "date", nullable: false),
EndDate = table.Column<DateOnly>(type: "date", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Seasons", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Specializations",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
ShortName = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Specializations", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Subjects",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
ShortName = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Subjects", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Seasons");
migrationBuilder.DropTable(
name: "Specializations");
migrationBuilder.DropTable(
name: "Subjects");
}
}
}