Skip to content

Commit

Permalink
feat: change the default length of the text field to long
Browse files Browse the repository at this point in the history
  • Loading branch information
chenos committed Apr 20, 2024
1 parent 65b1e7c commit 033d478
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/database/src/fields/text-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

0 comments on commit 033d478

Please sign in to comment.