using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace LANCommander.Migrations { /// public partial class AddUserCustomFields : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "UserCustomField", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), Name = table.Column(type: "TEXT", maxLength: 64, nullable: false), Value = table.Column(type: "TEXT", maxLength: 1024, nullable: false), UserId = table.Column(type: "TEXT", nullable: false), 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_UserCustomField", x => x.Id); table.ForeignKey( name: "FK_UserCustomField_AspNetUsers_CreatedById", column: x => x.CreatedById, principalTable: "AspNetUsers", principalColumn: "Id"); table.ForeignKey( name: "FK_UserCustomField_AspNetUsers_UpdatedById", column: x => x.UpdatedById, principalTable: "AspNetUsers", principalColumn: "Id"); table.ForeignKey( name: "FK_UserCustomField_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_UserCustomField_CreatedById", table: "UserCustomField", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_UserCustomField_UpdatedById", table: "UserCustomField", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_UserCustomField_UserId", table: "UserCustomField", column: "UserId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "UserCustomField"); } } }