Skip to content

Unable to use grate on UTF-8 collations #591

@SamuelMcAravey

Description

@SamuelMcAravey

Describe the bug
Unable to use UTF-8 collations with SQL Server due to using the obsolete text column type.

To Reproduce
Create a new database using a UTF-8 collation, such as Latin1_General_100_CI_AS_SC_UTF8, and run grate against this database.

Expected behavior
A successful migration happens.

Screenshots

image

Desktop (please complete the following information):

  • OS: Windows
  • Version: 1.8.0

Additional context
When running this through the debugger, I get this specific exception which indicates that this is due to the text type:

'Column or parameter 'text_of_script' has type 'text' and collation 'Latin1_General_100_CI_AS_SC_UTF8'.
The legacy LOB types do not support UTF-8 or UTF-16 encodings. 
Use types varchar(max), nvarchar(max) or a collation which does not have the _SC or _UTF8 flags.'

In my local version I changed all of the text types to nvarchar(max) and everything functioned as expected.

There appears to have been some prior discussion here, but it appears that the column type was not updated:
#250

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions