using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace LANCommander.Migrations { /// public partial class AddServerLogModel : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ServerLog", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), Name = table.Column(type: "TEXT", nullable: false), Path = table.Column(type: "TEXT", nullable: false), ServerId = table.Column(type: "TEXT", nullable: false), ServerId1 = table.Column(type: "TEXT", nullable: true), CreatedOn = table.Column(type: "TEXT", nullable: false), CreatedById = table.Column(type: "TEXT", nullable: true), UpdatedOn = table.Column(type: "TEXT", nullable: false), UpdatedById = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_ServerLog", x => x.Id); table.ForeignKey( name: "FK_ServerLog_AspNetUsers_CreatedById", column: x => x.CreatedById, principalTable: "AspNetUsers", principalColumn: "Id"); table.ForeignKey( name: "FK_ServerLog_AspNetUsers_UpdatedById", column: x => x.UpdatedById, principalTable: "AspNetUsers", principalColumn: "Id"); table.ForeignKey( name: "FK_ServerLog_Servers_ServerId", column: x => x.ServerId, principalTable: "Servers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_ServerLog_Servers_ServerId1", column: x => x.ServerId1, principalTable: "Servers", principalColumn: "Id"); }); migrationBuilder.CreateIndex( name: "IX_ServerLog_CreatedById", table: "ServerLog", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_ServerLog_ServerId", table: "ServerLog", column: "ServerId"); migrationBuilder.CreateIndex( name: "IX_ServerLog_ServerId1", table: "ServerLog", column: "ServerId1"); migrationBuilder.CreateIndex( name: "IX_ServerLog_UpdatedById", table: "ServerLog", column: "UpdatedById"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ServerLog"); } } }