154 lines
5.5 KiB
C#
154 lines
5.5 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
namespace tb320eva.Migrations
|
|
{
|
|
public partial class AddLevelScoreForGroup2 : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_eva_level_score_detail_eva_level_score_level_score_id",
|
|
table: "eva_level_score_detail");
|
|
|
|
migrationBuilder.AlterColumn<Guid>(
|
|
name: "level_score_id",
|
|
table: "eva_level_score_detail",
|
|
nullable: true,
|
|
oldClrType: typeof(Guid));
|
|
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "group_guid",
|
|
table: "eva_level_score_detail",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "behavior",
|
|
table: "eva_evaluation_behavior",
|
|
maxLength: 16000,
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldMaxLength: 1000,
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "achievement",
|
|
table: "eva_evaluation_achievement",
|
|
maxLength: 16000,
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldMaxLength: 8000,
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "properties",
|
|
table: "activity_log_eva",
|
|
maxLength: 32000,
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldMaxLength: 8000,
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "description",
|
|
table: "activity_log_eva",
|
|
maxLength: 32000,
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldMaxLength: 4000,
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_eva_level_score_detail_group_guid",
|
|
table: "eva_level_score_detail",
|
|
column: "group_guid");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_eva_level_score_detail_eva_evaluation_group_group_guid",
|
|
table: "eva_level_score_detail",
|
|
column: "group_guid",
|
|
principalTable: "eva_evaluation_group",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_eva_level_score_detail_eva_level_score_level_score_id",
|
|
table: "eva_level_score_detail",
|
|
column: "level_score_id",
|
|
principalTable: "eva_level_score",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_eva_level_score_detail_eva_evaluation_group_group_guid",
|
|
table: "eva_level_score_detail");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_eva_level_score_detail_eva_level_score_level_score_id",
|
|
table: "eva_level_score_detail");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_eva_level_score_detail_group_guid",
|
|
table: "eva_level_score_detail");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "group_guid",
|
|
table: "eva_level_score_detail");
|
|
|
|
migrationBuilder.AlterColumn<Guid>(
|
|
name: "level_score_id",
|
|
table: "eva_level_score_detail",
|
|
nullable: false,
|
|
oldClrType: typeof(Guid),
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "behavior",
|
|
table: "eva_evaluation_behavior",
|
|
maxLength: 1000,
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldMaxLength: 16000,
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "achievement",
|
|
table: "eva_evaluation_achievement",
|
|
maxLength: 8000,
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldMaxLength: 16000,
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "properties",
|
|
table: "activity_log_eva",
|
|
maxLength: 8000,
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldMaxLength: 32000,
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "description",
|
|
table: "activity_log_eva",
|
|
maxLength: 4000,
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldMaxLength: 32000,
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_eva_level_score_detail_eva_level_score_level_score_id",
|
|
table: "eva_level_score_detail",
|
|
column: "level_score_id",
|
|
principalTable: "eva_level_score",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
}
|
|
}
|