Files
FSI.BT.IR.Plc.Settings.Log/worker/FSI.BT.IR.Plc.Settings.Log/Migrations/20241018054354_OrganizationAdded.cs
Stephan Maier 37ec8a0ded Sicherung
2024-10-18 09:09:38 +02:00

53 lines
2.1 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace FSI.BT.IR.Plc.Settings.Log.Migrations
{
/// <inheritdoc />
public partial class OrganizationAdded : 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: 30, nullable: false),
ShortName = table.Column<string>(type: "TEXT", maxLength: 10, nullable: false),
Description = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
ParentId = table.Column<int>(type: "INTEGER", nullable: true),
Type = table.Column<int>(type: "INTEGER", nullable: false),
CreationTimeStamp = table.Column<DateTime>(type: "TEXT", nullable: false),
ModificationTimeStamp = 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");
}
}
}