diff --git a/libs/external-db-mysql/src/sql_schema_translator.spec.ts b/libs/external-db-mysql/src/sql_schema_translator.spec.ts index 5fc97f69c..28c0e29d3 100644 --- a/libs/external-db-mysql/src/sql_schema_translator.spec.ts +++ b/libs/external-db-mysql/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-mysql/src/sql_schema_translator.ts b/libs/external-db-mysql/src/sql_schema_translator.ts index 5247c4a24..a38fbe100 100644 --- a/libs/external-db-mysql/src/sql_schema_translator.ts +++ b/libs/external-db-mysql/src/sql_schema_translator.ts @@ -90,7 +90,7 @@ export default class SchemaColumnTranslato { return 'TIMESTAMP DEFAULT CURRENT_TIMESTAMP' case 'text_string': - return `VARCHAR${this.parseLength(precision)}` + return precision ? `VARCHAR${this.parseLength(precision)}` : 'TEXT' case 'text_small': case 'text_language': diff --git a/libs/external-db-postgres/src/sql_schema_translator.spec.ts b/libs/external-db-postgres/src/sql_schema_translator.spec.ts index c09f4b7d4..637c0e038 100644 --- a/libs/external-db-postgres/src/sql_schema_translator.spec.ts +++ b/libs/external-db-postgres/src/sql_schema_translator.spec.ts @@ -54,7 +54,7 @@ describe('Sql Schema Column Translator', () => { describe('string fields', () => { test('string', () => { - expect( env.schemaTranslator.columnToDbColumnSql({ name: ctx.fieldName, type: 'text', subtype: 'string' }) ).toEqual(`${escapeIdentifier(ctx.fieldName)} varchar(2048)`) + expect( env.schemaTranslator.columnToDbColumnSql({ name: ctx.fieldName, type: 'text', subtype: 'string' }) ).toEqual(`${escapeIdentifier(ctx.fieldName)} text`) }) test('string with length', () => { diff --git a/libs/external-db-postgres/src/sql_schema_translator.ts b/libs/external-db-postgres/src/sql_schema_translator.ts index 0966a06d1..d26421acc 100644 --- a/libs/external-db-postgres/src/sql_schema_translator.ts +++ b/libs/external-db-postgres/src/sql_schema_translator.ts @@ -97,7 +97,7 @@ export default class SchemaColumnTranslator { return 'timestamp' case 'text_string': - return `varchar${this.parseLength(precision)}` + return precision ? `varchar${this.parseLength(precision)}` : 'text' case 'text_small': case 'text_medium':