using System; using Microsoft.EntityFrameworkCore.Migrations; namespace RMuseum.Migrations { public partial class UserBehaviourLogs : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "LockoutMessage", table: "AspNetUsers", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "ScreenName", table: "AspNetUsers", type: "nvarchar(max)", nullable: true); migrationBuilder.CreateTable( name: "BannedEmails", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), NormalizedEmail = table.Column(type: "nvarchar(max)", nullable: true), Description = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_BannedEmails", x => x.Id); }); migrationBuilder.CreateTable( name: "UserBehaviourLogs", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), UserId = table.Column(type: "uniqueidentifier", nullable: false), DateTime = table.Column(type: "datetime2", nullable: false), Description = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_UserBehaviourLogs", x => x.Id); table.ForeignKey( name: "FK_UserBehaviourLogs_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_UserBehaviourLogs_UserId", table: "UserBehaviourLogs", column: "UserId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "BannedEmails"); migrationBuilder.DropTable( name: "UserBehaviourLogs"); migrationBuilder.DropColumn( name: "LockoutMessage", table: "AspNetUsers"); migrationBuilder.DropColumn( name: "ScreenName", table: "AspNetUsers"); } } }