using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace FSI.BT.IR.Organization.Db.Migrations { /// public partial class Init : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Organizations", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Name = table.Column(type: "TEXT", maxLength: 64, nullable: false), ShortName = table.Column(type: "TEXT", maxLength: 16, nullable: false), Description = table.Column(type: "TEXT", maxLength: 128, nullable: true), ParentId = table.Column(type: "INTEGER", nullable: true), Type = table.Column(type: "INTEGER", nullable: false), Created = table.Column(type: "TEXT", nullable: false), Updated = table.Column(type: "TEXT", nullable: false), FullShortName = table.Column(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"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Organizations"); } } }