Files
FSI.BT.IR.Organization/scr/FSI.BT.IR.Organization.Db/Migrations/20241025073330_Init.cs
2024-10-25 13:35:06 +02:00

53 lines
2.1 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace FSI.BT.IR.Organization.Db.Migrations
{
/// <inheritdoc />
public partial class Init : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Organizations",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false),
ShortName = table.Column<string>(type: "TEXT", maxLength: 16, nullable: false),
Description = table.Column<string>(type: "TEXT", maxLength: 128, nullable: true),
ParentId = table.Column<int>(type: "INTEGER", nullable: true),
Type = table.Column<int>(type: "INTEGER", nullable: false),
Created = table.Column<DateTime>(type: "TEXT", nullable: false),
Updated = table.Column<DateTime>(type: "TEXT", nullable: false),
FullShortName = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Organizations", x => x.Id);
table.ForeignKey(
name: "FK_Organizations_Organizations_ParentId",
column: x => x.ParentId,
principalTable: "Organizations",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_Organizations_ParentId",
table: "Organizations",
column: "ParentId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Organizations");
}
}
}