using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PARR.DAL.Migrations
{
///
public partial class tblTemplateHistory : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "InitiatorComment",
table: "Templates",
type: "text",
nullable: true);
migrationBuilder.AddColumn(
name: "InitiatorIp",
table: "Templates",
type: "text",
nullable: true);
migrationBuilder.AddColumn(
name: "InitiatorParrComponentId",
table: "Templates",
type: "integer",
nullable: true);
migrationBuilder.CreateTable(
name: "TemplateHistories",
columns: table => new
{
Id = table.Column(type: "uuid", nullable: false),
ParentId = table.Column(type: "uuid", nullable: false),
DateAddedToHistory = table.Column(type: "timestamp with time zone", nullable: false),
InitiatorIp = table.Column(type: "text", nullable: true),
InitiatorParrComponentId = table.Column(type: "integer", nullable: true),
InitiatorComment = table.Column(type: "text", nullable: true),
DateModified = table.Column(type: "timestamp with time zone", nullable: true),
Name = table.Column(type: "text", nullable: false),
IsActiveTemplate = table.Column(type: "boolean", nullable: false),
IsActiveSchedule = table.Column(type: "boolean", nullable: false),
LastRun = table.Column(type: "timestamp with time zone", nullable: true),
NextRun = table.Column(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TemplateHistories", x => x.Id);
table.ForeignKey(
name: "FK_TemplateHistories_Templates_ParentId",
column: x => x.ParentId,
principalTable: "Templates",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_TemplateHistories_ParentId",
table: "TemplateHistories",
column: "ParentId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "TemplateHistories");
migrationBuilder.DropColumn(
name: "InitiatorComment",
table: "Templates");
migrationBuilder.DropColumn(
name: "InitiatorIp",
table: "Templates");
migrationBuilder.DropColumn(
name: "InitiatorParrComponentId",
table: "Templates");
}
}
}