Skip to content

Conversation

@AlexJacksonDS
Copy link
Contributor

@AlexJacksonDS AlexJacksonDS commented Nov 8, 2021

JIRA link

https://softwiretech.atlassian.net/browse/HEEDLS-631

Description

Migration to reduce the size of Groups.GroupDescription from nvarchar(max) to nvarchar(1000), truncating any values over this limit (there should hopefully still be none by the time this makes it live)

Screenshots

N/A


Developer checks

(Leave tasks unticked if they haven't been appropriate for your ticket.)

I have:

  • Run the formatter and made sure there are no IDE errors.
  • Written tests for the changes (accessibility tests, unit tests for controller, data services, services, view models, etc)
  • Manually tested my work with and without JavaScript. Full manual testing guidelines can be found here: https://softwiretech.atlassian.net/wiki/spaces/HEE/pages/6703648740/Testing
  • Updated/added documentation in Swiki and/or Readme. Links (if any) are below:
  • Updated my Jira ticket with information about other parts of the system that were touched as part of the MR and have to be sanity tested to ensure nothing’s broken.
  • Scanned over my own MR to ensure everything is as expected.

Copy link
Contributor

@JBsoftwire JBsoftwire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

public override void Up()
{
Execute.Sql("UPDATE Groups SET GroupDescription = LEFT(GroupDescription, 1000)");
Alter.Table("Groups").AlterColumn("GroupDescription").AsString(1000).Nullable();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this specify the number of characters or the number of bytes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'll set it to a nvarchar(1000)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grand. Are you confident you can fit a 1000-character string in there? I'm slightly hazy on this, especially where character encodings are concerned, but if you're confident / have tested then merge away.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I've put a 1000 character string xxxxxxxxx... into mine, and it truncated the longer one down.

@AlexJacksonDS AlexJacksonDS merged commit 20846f0 into master Nov 17, 2021
@AlexJacksonDS AlexJacksonDS deleted the HEEDLS-631-group-description-migration branch November 17, 2021 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants