I have a suggestion for an upgrade of umbraco migrations which can be used to create custom database tables. I don't know where to post a suggestion like this so if there is a better place, please let me know!
When using umbraco migrations to create custom database tables, I would like to have the option to create a column with datatype NTEXT instead of just using NVARCHAR (as from AsString()). This to allow longer text to be stored than maximum length of NVARCHAR which is 4000 characters.
yeah, thinking about it - it might exist this way on purpose,
in the code above the SQLSyntax line gets NTEXT for the database type you are running on (SqlServer, SqlExpress or mySql) it might be that it's diffrent depending on the platform, and that's why its not in the core as its own function ?
Ability to create column as text with migrations
Hi,
I have a suggestion for an upgrade of umbraco migrations which can be used to create custom database tables. I don't know where to post a suggestion like this so if there is a better place, please let me know!
When using umbraco migrations to create custom database tables, I would like to have the option to create a column with datatype NTEXT instead of just using NVARCHAR (as from AsString()). This to allow longer text to be stored than maximum length of NVARCHAR which is 4000 characters.
So you can use:
instead of:
Hi Jonathan,
I think you can - although it's not straight forward.
using the
AsCustom
optionthis bit of code is from one of the Migrations inside umbraco and it creates a NTEXT column.
Although an
AsNTEXT()
would be nice :) - you could log an issue in github ? ( https://github.com/umbraco/Umbraco-CMS/issues ) and its probibly not a big change in terms of code as its just one more function in this file ... https://github.com/umbraco/Umbraco-CMS/blob/1bb593d264a085f94a3ce3bd710392b350561430/src/Umbraco.Core/Persistence/Migrations/Syntax/ExpressionBuilder.cs#L142Kevin
Thank you!
I was looking for some kind of work around but never thought of the custom type. I can log an issue on github.
Thank again!
yeah, thinking about it - it might exist this way on purpose,
in the code above the SQLSyntax line gets NTEXT for the database type you are running on (SqlServer, SqlExpress or mySql) it might be that it's diffrent depending on the platform, and that's why its not in the core as its own function ?
Kevin
is working on a reply...