Updated angel_migration_runner
This commit is contained in:
parent
28c4705898
commit
91f405811b
2 changed files with 5 additions and 6 deletions
|
@ -3,6 +3,9 @@
|
||||||
## 4.0.0-beta.3
|
## 4.0.0-beta.3
|
||||||
|
|
||||||
* Updated README
|
* Updated README
|
||||||
|
* Fixed NNBD issue
|
||||||
|
* Default database column to `varchar` type
|
||||||
|
* Default the `varchar` column size to 256
|
||||||
|
|
||||||
## 4.0.0-beta.2
|
## 4.0.0-beta.2
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,7 @@ import 'package:charcode/ascii.dart';
|
||||||
abstract class PostgresGenerator {
|
abstract class PostgresGenerator {
|
||||||
static String columnType(MigrationColumn column) {
|
static String columnType(MigrationColumn column) {
|
||||||
var str = column.type.name;
|
var str = column.type.name;
|
||||||
if (column.length != null) {
|
return '$str(${column.length})';
|
||||||
return '$str(${column.length})';
|
|
||||||
} else {
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static String compileColumn(MigrationColumn column) {
|
static String compileColumn(MigrationColumn column) {
|
||||||
|
@ -147,7 +143,7 @@ class PostgresAlterTable extends Table implements MutableTable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void changeColumnType(String name, ColumnType type, {int? length}) {
|
void changeColumnType(String name, ColumnType type, {int length = 256}) {
|
||||||
_stack.add('ALTER COLUMN "$name" TYPE ' +
|
_stack.add('ALTER COLUMN "$name" TYPE ' +
|
||||||
PostgresGenerator.columnType(MigrationColumn(type, length: length)));
|
PostgresGenerator.columnType(MigrationColumn(type, length: length)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue