From 033d478b76b1bf78085c928c3acfc21056883632 Mon Sep 17 00:00:00 2001 From: chenos Date: Sat, 20 Apr 2024 20:42:08 +0800 Subject: [PATCH] feat: change the default length of the text field to long --- packages/core/database/src/fields/text-field.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/database/src/fields/text-field.ts b/packages/core/database/src/fields/text-field.ts index c1d15e4e41558..0441aa4e50ea5 100644 --- a/packages/core/database/src/fields/text-field.ts +++ b/packages/core/database/src/fields/text-field.ts @@ -3,10 +3,14 @@ import { BaseColumnFieldOptions, Field } from './field'; export class TextField extends Field { get dataType() { + if (this.database.inDialect('mysql', 'mariadb')) { + return DataTypes.TEXT(this.options.length || 'long'); + } return DataTypes.TEXT; } } export interface TextFieldOptions extends BaseColumnFieldOptions { type: 'text'; + length?: 'tiny' | 'medium' | 'long'; }