irc-netcore-api/IRaCIS.Core.Infra.EFCore/Migrations/20250225023941_testTrialFil...

682 lines
24 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
/// <inheritdoc />
public partial class testTrialFile : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
//migrationBuilder.AlterTable(
// name: "TrialFinalRecord",
// comment: "项目文件 - 定稿记录表");
//migrationBuilder.AlterTable(
// name: "TrialFileType",
// comment: "项目文件 - 文件类型表");
//migrationBuilder.AlterTable(
// name: "TrialFile",
// comment: "项目文件 - 文件表");
//migrationBuilder.AlterColumn<Guid>(
// name: "CreateUserId",
// table: "TrialFinalRecord",
// type: "uniqueidentifier",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
// oldClrType: typeof(Guid),
// oldType: "uniqueidentifier",
// oldNullable: true);
//migrationBuilder.AddColumn<Guid>(
// name: "Id",
// table: "TrialFinalRecord",
// type: "uniqueidentifier",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
//migrationBuilder.AddColumn<DateTime>(
// name: "CreateTime",
// table: "TrialFinalRecord",
// type: "datetime2",
// nullable: false,
// defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
//migrationBuilder.AddColumn<bool>(
// name: "IsAuthorizedView",
// table: "TrialFinalRecord",
// type: "bit",
// nullable: false,
// defaultValue: false,
// comment: "是否授权查看");
//migrationBuilder.AddColumn<string>(
// name: "Name",
// table: "TrialFinalRecord",
// type: "nvarchar(400)",
// maxLength: 400,
// nullable: false,
// defaultValue: "");
//migrationBuilder.AlterColumn<Guid>(
// name: "PDFFileRecordId",
// table: "TrialFinalRecord",
// type: "uniqueidentifier",
// nullable: true
// );
//migrationBuilder.AlterColumn<Guid>(
// name: "SignFileRecordId",
// table: "TrialFinalRecord",
// type: "uniqueidentifier",
// nullable: true
// );
//migrationBuilder.AlterColumn<Guid>(
// name: "WordFileRecordId",
// table: "TrialFinalRecord",
// type: "uniqueidentifier",
// nullable: true
// );
//migrationBuilder.AddColumn<Guid>(
// name: "HistoryFileRecordId",
// table: "TrialFinalRecord",
// type: "uniqueidentifier",
// nullable: true
// );
//migrationBuilder.AddColumn<int>(
// name: "State",
// table: "TrialFinalRecord",
// type: "int",
// nullable: false,
// defaultValue: 0);
//migrationBuilder.AddColumn<Guid>(
// name: "TrialFileTypeId",
// table: "TrialFinalRecord",
// type: "uniqueidentifier",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
// comment: "关联项目文件类型");
//migrationBuilder.AddColumn<Guid>(
// name: "TrialId",
// table: "TrialFinalRecord",
// type: "uniqueidentifier",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
//migrationBuilder.AddColumn<DateTime>(
// name: "UpdateTime",
// table: "TrialFinalRecord",
// type: "datetime2",
// nullable: false,
// defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
//migrationBuilder.AddColumn<Guid>(
// name: "UpdateUserId",
// table: "TrialFinalRecord",
// type: "uniqueidentifier",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
//migrationBuilder.AddColumn<string>(
// name: "Version",
// table: "TrialFinalRecord",
// type: "nvarchar(400)",
// maxLength: 400,
// nullable: false,
// defaultValue: "");
//migrationBuilder.AlterColumn<Guid>(
// name: "CreateUserId",
// table: "TrialFileType",
// type: "uniqueidentifier",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
// oldClrType: typeof(Guid),
// oldType: "uniqueidentifier",
// oldNullable: true);
//migrationBuilder.AddColumn<Guid>(
// name: "Id",
// table: "TrialFileType",
// type: "uniqueidentifier",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
//migrationBuilder.AddColumn<int>(
// name: "ArchiveTypeEnum",
// table: "TrialFileType",
// type: "int",
// nullable: false,
// defaultValue: 0,
// comment: "报告、文档、记录");
//migrationBuilder.AddColumn<DateTime>(
// name: "CreateTime",
// table: "TrialFileType",
// type: "datetime2",
// nullable: false,
// defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
//migrationBuilder.AddColumn<DateOnly>(
// name: "FirstFinalDate",
// table: "TrialFileType",
// type: "date",
// nullable: false,
// defaultValue: new DateOnly(1, 1, 1),
// comment: "首次定稿日期");
//migrationBuilder.AddColumn<bool>(
// name: "IsAuthorizedView",
// table: "TrialFileType",
// type: "bit",
// nullable: false,
// defaultValue: false,
// comment: "是否授权查看");
//migrationBuilder.AddColumn<bool>(
// name: "IsConfirmRecord",
// table: "TrialFileType",
// type: "bit",
// nullable: false,
// defaultValue: false,
// comment: "是否确认收入项");
//migrationBuilder.AddColumn<bool>(
// name: "IsEnable",
// table: "TrialFileType",
// type: "bit",
// nullable: false,
// defaultValue: false);
//migrationBuilder.AddColumn<bool>(
// name: "IsSelfDefine",
// table: "TrialFileType",
// type: "bit",
// nullable: false,
// defaultValue: false,
// comment: "是否自定义");
//migrationBuilder.AddColumn<string>(
// name: "Name",
// table: "TrialFileType",
// type: "nvarchar(400)",
// maxLength: 400,
// nullable: false,
// defaultValue: "");
//migrationBuilder.AddColumn<string>(
// name: "NameCN",
// table: "TrialFileType",
// type: "nvarchar(400)",
// maxLength: 400,
// nullable: false,
// defaultValue: "");
//migrationBuilder.AddColumn<int>(
// name: "ShowOrder",
// table: "TrialFileType",
// type: "int",
// nullable: false,
// defaultValue: 0);
//migrationBuilder.AddColumn<int>(
// name: "SubIdentificationEnum",
// table: "TrialFileType",
// type: "int",
// nullable: false,
// defaultValue: 0,
// comment: "子类标识,是取那个表的数据");
//migrationBuilder.AddColumn<Guid>(
// name: "SysFileTypeId",
// table: "TrialFileType",
// type: "uniqueidentifier",
// nullable: true,
// comment: "关联系统文件类型");
//migrationBuilder.AddColumn<Guid>(
// name: "TrialId",
// table: "TrialFileType",
// type: "uniqueidentifier",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
//migrationBuilder.AddColumn<DateTime>(
// name: "UpdateTime",
// table: "TrialFileType",
// type: "datetime2",
// nullable: false,
// defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
//migrationBuilder.AddColumn<Guid>(
// name: "UpdateUserId",
// table: "TrialFileType",
// type: "uniqueidentifier",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
//migrationBuilder.AlterColumn<Guid>(
// name: "CreateUserId",
// table: "TrialFile",
// type: "uniqueidentifier",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
// oldClrType: typeof(Guid),
// oldType: "uniqueidentifier",
// oldNullable: true);
//migrationBuilder.AddColumn<Guid>(
// name: "Id",
// table: "TrialFile",
// type: "uniqueidentifier",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
//migrationBuilder.AddColumn<DateTime>(
// name: "CreateTime",
// table: "TrialFile",
// type: "datetime2",
// nullable: false,
// defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
//migrationBuilder.AddColumn<string>(
// name: "FileFormat",
// table: "TrialFile",
// type: "nvarchar(400)",
// maxLength: 400,
// nullable: false,
// defaultValue: "");
//migrationBuilder.AddColumn<string>(
// name: "FileName",
// table: "TrialFile",
// type: "nvarchar(400)",
// maxLength: 400,
// nullable: false,
// defaultValue: "");
//migrationBuilder.AddColumn<string>(
// name: "FilePath",
// table: "TrialFile",
// type: "nvarchar(1000)",
// maxLength: 1000,
// nullable: false,
// defaultValue: "");
//migrationBuilder.AddColumn<string>(
// name: "FileSize",
// table: "TrialFile",
// type: "nvarchar(400)",
// maxLength: 400,
// nullable: false,
// defaultValue: "");
//migrationBuilder.AddColumn<Guid>(
// name: "TrialFileTypeId",
// table: "TrialFile",
// type: "uniqueidentifier",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
// comment: "关联项目文件类型");
//migrationBuilder.AddColumn<DateTime>(
// name: "UpdateTime",
// table: "TrialFile",
// type: "datetime2",
// nullable: false,
// defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
//migrationBuilder.AddColumn<Guid>(
// name: "UpdateUserId",
// table: "TrialFile",
// type: "uniqueidentifier",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
//migrationBuilder.AddPrimaryKey(
// name: "PK_TrialFinalRecord",
// table: "TrialFinalRecord",
// column: "Id");
//migrationBuilder.AddPrimaryKey(
// name: "PK_TrialFileType",
// table: "TrialFileType",
// column: "Id");
//migrationBuilder.AddPrimaryKey(
// name: "PK_TrialFile",
// table: "TrialFile",
// column: "Id");
//migrationBuilder.CreateIndex(
// name: "IX_TrialFinalRecord_CreateUserId",
// table: "TrialFinalRecord",
// column: "CreateUserId");
//migrationBuilder.CreateIndex(
// name: "IX_TrialFinalRecord_HistoryFileRecordId",
// table: "TrialFinalRecord",
// column: "HistoryFileRecordId");
//migrationBuilder.CreateIndex(
// name: "IX_TrialFinalRecord_PDFFileRecordId",
// table: "TrialFinalRecord",
// column: "PDFFileRecordId");
//migrationBuilder.CreateIndex(
// name: "IX_TrialFinalRecord_SignFileRecordId",
// table: "TrialFinalRecord",
// column: "SignFileRecordId");
//migrationBuilder.CreateIndex(
// name: "IX_TrialFinalRecord_WordFileRecordId",
// table: "TrialFinalRecord",
// column: "WordFileRecordId");
//migrationBuilder.CreateIndex(
// name: "IX_TrialFileType_CreateUserId",
// table: "TrialFileType",
// column: "CreateUserId");
//migrationBuilder.CreateIndex(
// name: "IX_TrialFile_CreateUserId",
// table: "TrialFile",
// column: "CreateUserId");
migrationBuilder.AddForeignKey(
name: "FK_TrialFinalRecord_TrialFile_HistoryFileRecordId",
table: "TrialFinalRecord",
column: "HistoryFileRecordId",
principalTable: "TrialFile",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_TrialFinalRecord_TrialFile_PDFFileRecordId",
table: "TrialFinalRecord",
column: "PDFFileRecordId",
principalTable: "TrialFile",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_TrialFinalRecord_TrialFile_SignFileRecordId",
table: "TrialFinalRecord",
column: "SignFileRecordId",
principalTable: "TrialFile",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_TrialFinalRecord_TrialFile_WordFileRecordId",
table: "TrialFinalRecord",
column: "WordFileRecordId",
principalTable: "TrialFile",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_TrialFinalRecord_TrialFile_HistoryFileRecordId",
table: "TrialFinalRecord");
migrationBuilder.DropForeignKey(
name: "FK_TrialFinalRecord_TrialFile_PDFFileRecordId",
table: "TrialFinalRecord");
migrationBuilder.DropForeignKey(
name: "FK_TrialFinalRecord_TrialFile_SignFileRecordId",
table: "TrialFinalRecord");
migrationBuilder.DropForeignKey(
name: "FK_TrialFinalRecord_TrialFile_WordFileRecordId",
table: "TrialFinalRecord");
migrationBuilder.DropPrimaryKey(
name: "PK_TrialFinalRecord",
table: "TrialFinalRecord");
migrationBuilder.DropIndex(
name: "IX_TrialFinalRecord_CreateUserId",
table: "TrialFinalRecord");
migrationBuilder.DropIndex(
name: "IX_TrialFinalRecord_HistoryFileRecordId",
table: "TrialFinalRecord");
migrationBuilder.DropIndex(
name: "IX_TrialFinalRecord_PDFFileRecordId",
table: "TrialFinalRecord");
migrationBuilder.DropIndex(
name: "IX_TrialFinalRecord_SignFileRecordId",
table: "TrialFinalRecord");
migrationBuilder.DropIndex(
name: "IX_TrialFinalRecord_WordFileRecordId",
table: "TrialFinalRecord");
migrationBuilder.DropPrimaryKey(
name: "PK_TrialFileType",
table: "TrialFileType");
migrationBuilder.DropIndex(
name: "IX_TrialFileType_CreateUserId",
table: "TrialFileType");
migrationBuilder.DropPrimaryKey(
name: "PK_TrialFile",
table: "TrialFile");
migrationBuilder.DropIndex(
name: "IX_TrialFile_CreateUserId",
table: "TrialFile");
migrationBuilder.DropColumn(
name: "Id",
table: "TrialFinalRecord");
migrationBuilder.DropColumn(
name: "CreateTime",
table: "TrialFinalRecord");
migrationBuilder.DropColumn(
name: "HistoryFileRecordId",
table: "TrialFinalRecord");
migrationBuilder.DropColumn(
name: "IsAuthorizedView",
table: "TrialFinalRecord");
migrationBuilder.DropColumn(
name: "Name",
table: "TrialFinalRecord");
migrationBuilder.DropColumn(
name: "PDFFileRecordId",
table: "TrialFinalRecord");
migrationBuilder.DropColumn(
name: "SignFileRecordId",
table: "TrialFinalRecord");
migrationBuilder.DropColumn(
name: "State",
table: "TrialFinalRecord");
migrationBuilder.DropColumn(
name: "TrialFileTypeId",
table: "TrialFinalRecord");
migrationBuilder.DropColumn(
name: "TrialId",
table: "TrialFinalRecord");
migrationBuilder.DropColumn(
name: "UpdateTime",
table: "TrialFinalRecord");
migrationBuilder.DropColumn(
name: "UpdateUserId",
table: "TrialFinalRecord");
migrationBuilder.DropColumn(
name: "Version",
table: "TrialFinalRecord");
migrationBuilder.DropColumn(
name: "WordFileRecordId",
table: "TrialFinalRecord");
migrationBuilder.DropColumn(
name: "Id",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "ArchiveTypeEnum",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "CreateTime",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "FirstFinalDate",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "IsAuthorizedView",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "IsConfirmRecord",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "IsEnable",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "IsSelfDefine",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "Name",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "NameCN",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "ShowOrder",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "SubIdentificationEnum",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "SysFileTypeId",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "TrialId",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "UpdateTime",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "UpdateUserId",
table: "TrialFileType");
migrationBuilder.DropColumn(
name: "Id",
table: "TrialFile");
migrationBuilder.DropColumn(
name: "CreateTime",
table: "TrialFile");
migrationBuilder.DropColumn(
name: "FileFormat",
table: "TrialFile");
migrationBuilder.DropColumn(
name: "FileName",
table: "TrialFile");
migrationBuilder.DropColumn(
name: "FilePath",
table: "TrialFile");
migrationBuilder.DropColumn(
name: "FileSize",
table: "TrialFile");
migrationBuilder.DropColumn(
name: "TrialFileTypeId",
table: "TrialFile");
migrationBuilder.DropColumn(
name: "UpdateTime",
table: "TrialFile");
migrationBuilder.DropColumn(
name: "UpdateUserId",
table: "TrialFile");
migrationBuilder.AlterTable(
name: "TrialFinalRecord",
oldComment: "项目文件 - 定稿记录表");
migrationBuilder.AlterTable(
name: "TrialFileType",
oldComment: "项目文件 - 文件类型表");
migrationBuilder.AlterTable(
name: "TrialFile",
oldComment: "项目文件 - 文件表");
migrationBuilder.AlterColumn<Guid>(
name: "CreateUserId",
table: "TrialFinalRecord",
type: "uniqueidentifier",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier");
migrationBuilder.AlterColumn<Guid>(
name: "CreateUserId",
table: "TrialFileType",
type: "uniqueidentifier",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier");
migrationBuilder.AlterColumn<Guid>(
name: "CreateUserId",
table: "TrialFile",
type: "uniqueidentifier",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier");
}
}
}