using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace Ombi.Store.Migrations { public partial class RequestLimit : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "EpisodeRequestLimit", table: "AspNetUsers", type: "INTEGER", nullable: true); migrationBuilder.AddColumn( name: "MovieRequestLimit", table: "AspNetUsers", type: "INTEGER", nullable: true); migrationBuilder.CreateTable( name: "RequestLog", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), EpisodeCount = table.Column(type: "INTEGER", nullable: false), RequestDate = table.Column(type: "TEXT", nullable: false), RequestId = table.Column(type: "INTEGER", nullable: false), RequestType = table.Column(type: "INTEGER", nullable: false), UserId = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_RequestLog", x => x.Id); table.ForeignKey( name: "FK_RequestLog_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_RequestLog_UserId", table: "RequestLog", column: "UserId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "RequestLog"); migrationBuilder.DropColumn( name: "EpisodeRequestLimit", table: "AspNetUsers"); migrationBuilder.DropColumn( name: "MovieRequestLimit", table: "AspNetUsers"); } } }