You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/src/Ombi.Store/Migrations/20171208232545_RequestLimit.cs

67 lines
2.4 KiB

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<int>(
name: "EpisodeRequestLimit",
table: "AspNetUsers",
type: "INTEGER",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "MovieRequestLimit",
table: "AspNetUsers",
type: "INTEGER",
nullable: true);
migrationBuilder.CreateTable(
name: "RequestLog",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
EpisodeCount = table.Column<int>(type: "INTEGER", nullable: false),
RequestDate = table.Column<DateTime>(type: "TEXT", nullable: false),
RequestId = table.Column<int>(type: "INTEGER", nullable: false),
RequestType = table.Column<int>(type: "INTEGER", nullable: false),
UserId = table.Column<string>(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");
}
}
}