using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BLAIzor.Migrations
{
///
public partial class AddFormDefinition : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "FormDefinitions",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
SiteInfoId = table.Column(type: "int", nullable: false),
Title = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
Slug = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
Description = table.Column(type: "nvarchar(max)", nullable: true),
JsonDefinition = table.Column(type: "nvarchar(max)", nullable: false),
Version = table.Column(type: "int", nullable: false),
CreatedAt = table.Column(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FormDefinitions", x => x.Id);
table.ForeignKey(
name: "FK_FormDefinitions_SiteInfos_SiteInfoId",
column: x => x.SiteInfoId,
principalTable: "SiteInfos",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_FormDefinitions_SiteInfoId",
table: "FormDefinitions",
column: "SiteInfoId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "FormDefinitions");
}
}
}