diff --git a/libs/external-db-mssql/src/sql_schema_translator.spec.ts b/libs/external-db-mssql/src/sql_schema_translator.spec.ts index 311142309..05f696e07 100644 --- a/libs/external-db-mssql/src/sql_schema_translator.spec.ts +++ b/libs/external-db-mssql/src/sql_schema_translator.spec.ts @@ -68,7 +68,7 @@ describe('Sql Schema Column Translator', () => { describe('string fields', () => { test('string', () => { - expect( env.schemaTranslator.columnToDbColumnSql({ name: ctx.fieldName, type: 'text', subtype: 'string' }) ).toEqual(`${escapeId(ctx.fieldName)} VARCHAR(2048)`) + expect( env.schemaTranslator.columnToDbColumnSql({ name: ctx.fieldName, type: 'text', subtype: 'string' }) ).toEqual(`${escapeId(ctx.fieldName)} TEXT`) }) test('string with length', () => { diff --git a/libs/external-db-mssql/src/sql_schema_translator.ts b/libs/external-db-mssql/src/sql_schema_translator.ts index 0f268f426..557e4d656 100644 --- a/libs/external-db-mssql/src/sql_schema_translator.ts +++ b/libs/external-db-mssql/src/sql_schema_translator.ts @@ -83,7 +83,7 @@ export default class SchemaColumnTranslator { return 'SMALLDATETIME' case 'text_string': - return `VARCHAR${this.parseLength(precision)}` + return precision ? `VARCHAR${this.parseLength(precision)}` : 'TEXT' case 'text_small': case 'text_medium':