From 91f405811bdec291c07e57fc950a3f5a782ba162 Mon Sep 17 00:00:00 2001 From: thomashii Date: Mon, 19 Jul 2021 12:55:50 +0800 Subject: [PATCH] Updated angel_migration_runner --- packages/orm/angel_migration_runner/CHANGELOG.md | 3 +++ .../angel_migration_runner/lib/src/postgres/table.dart | 8 ++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/orm/angel_migration_runner/CHANGELOG.md b/packages/orm/angel_migration_runner/CHANGELOG.md index 114d23e1..5eb68bd4 100755 --- a/packages/orm/angel_migration_runner/CHANGELOG.md +++ b/packages/orm/angel_migration_runner/CHANGELOG.md @@ -3,6 +3,9 @@ ## 4.0.0-beta.3 * Updated README +* Fixed NNBD issue +* Default database column to `varchar` type +* Default the `varchar` column size to 256 ## 4.0.0-beta.2 diff --git a/packages/orm/angel_migration_runner/lib/src/postgres/table.dart b/packages/orm/angel_migration_runner/lib/src/postgres/table.dart index c31c2c9b..6e68a111 100755 --- a/packages/orm/angel_migration_runner/lib/src/postgres/table.dart +++ b/packages/orm/angel_migration_runner/lib/src/postgres/table.dart @@ -6,11 +6,7 @@ import 'package:charcode/ascii.dart'; abstract class PostgresGenerator { static String columnType(MigrationColumn column) { var str = column.type.name; - if (column.length != null) { - return '$str(${column.length})'; - } else { - return str; - } + return '$str(${column.length})'; } static String compileColumn(MigrationColumn column) { @@ -147,7 +143,7 @@ class PostgresAlterTable extends Table implements MutableTable { } @override - void changeColumnType(String name, ColumnType type, {int? length}) { + void changeColumnType(String name, ColumnType type, {int length = 256}) { _stack.add('ALTER COLUMN "$name" TYPE ' + PostgresGenerator.columnType(MigrationColumn(type, length: length))); }