diff --git a/DigitalLearningSolutions.Data.Migrations/202111081225_ReduceGroupsGroupDescriptionLength.cs b/DigitalLearningSolutions.Data.Migrations/202111081225_ReduceGroupsGroupDescriptionLength.cs new file mode 100644 index 0000000000..2706d0b3e7 --- /dev/null +++ b/DigitalLearningSolutions.Data.Migrations/202111081225_ReduceGroupsGroupDescriptionLength.cs @@ -0,0 +1,19 @@ +namespace DigitalLearningSolutions.Data.Migrations +{ + using FluentMigrator; + + [Migration(202111081225)] + public class ReduceGroupsGroupDescriptionLength : Migration + { + public override void Up() + { + Execute.Sql("UPDATE Groups SET GroupDescription = LEFT(GroupDescription, 1000)"); + Alter.Table("Groups").AlterColumn("GroupDescription").AsString(1000).Nullable(); + } + + public override void Down() + { + Alter.Table("Groups").AlterColumn("GroupDescription").AsString(int.MaxValue).Nullable(); + } + } +}