86 lines
3.7 KiB
C#
86 lines
3.7 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class TrialDocumentAttachment : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "TrialDocumentId",
|
|
table: "SystemDocumentAttachment",
|
|
type: "uniqueidentifier",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "TrialDocumentAttachment",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
TrialDocumentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
Name = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
|
FileName = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
|
OffLine = table.Column<bool>(type: "bit", nullable: false),
|
|
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),
|
|
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_TrialDocumentAttachment", x => x.Id);
|
|
},
|
|
comment: "项目签署文档附件");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_SystemDocumentAttachment_TrialDocumentId",
|
|
table: "SystemDocumentAttachment",
|
|
column: "TrialDocumentId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_TrialDocumentAttachment_CreateUserId",
|
|
table: "TrialDocumentAttachment",
|
|
column: "CreateUserId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_TrialDocumentAttachment_TrialDocumentId",
|
|
table: "TrialDocumentAttachment",
|
|
column: "TrialDocumentId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_SystemDocumentAttachment_TrialDocument_TrialDocumentId",
|
|
table: "SystemDocumentAttachment",
|
|
column: "TrialDocumentId",
|
|
principalTable: "TrialDocument",
|
|
principalColumn: "Id");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_SystemDocumentAttachment_TrialDocument_TrialDocumentId",
|
|
table: "SystemDocumentAttachment");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "TrialDocumentAttachment");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_SystemDocumentAttachment_TrialDocumentId",
|
|
table: "SystemDocumentAttachment");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "TrialDocumentId",
|
|
table: "SystemDocumentAttachment");
|
|
}
|
|
}
|
|
}
|