59 lines
2.7 KiB
C#
59 lines
2.7 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AuditDocument : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "AuditDocument",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
Name = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
|
AuditDocumentEnum = table.Column<int>(type: "int", nullable: false),
|
|
ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
|
FilePath = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: false),
|
|
FileSize = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true),
|
|
FileFormat = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
|
Version = table.Column<int>(type: "int", nullable: true),
|
|
MainFileId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
|
IsAuthorization = table.Column<bool>(type: "bit", nullable: false),
|
|
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AuditDocument", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_AuditDocument_User_CreateUserId",
|
|
column: x => x.CreateUserId,
|
|
principalTable: "User",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
},
|
|
comment: "稽查文档管理");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AuditDocument_CreateUserId",
|
|
table: "AuditDocument",
|
|
column: "CreateUserId");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "AuditDocument");
|
|
}
|
|
}
|
|
}
|