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