From 2deaf5d2998ff3e0d090ac7ed5ef83b87d69364d Mon Sep 17 00:00:00 2001 From: "thomashii@dukefirehawk.com" Date: Sun, 2 May 2021 15:36:33 +0800 Subject: [PATCH] Migrated angel_migration --- packages/orm/angel_migration/lib/src/column.dart | 14 +++++++------- packages/orm/angel_migration/lib/src/table.dart | 2 +- packages/orm/angel_migration/pubspec.yaml | 7 +++---- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/packages/orm/angel_migration/lib/src/column.dart b/packages/orm/angel_migration/lib/src/column.dart index e06438b7..4451ca5e 100755 --- a/packages/orm/angel_migration/lib/src/column.dart +++ b/packages/orm/angel_migration/lib/src/column.dart @@ -2,23 +2,23 @@ import 'package:angel_orm/angel_orm.dart'; class MigrationColumn extends Column { final List _references = []; - bool _nullable; - IndexType _index; + late bool _nullable; + IndexType? _index; dynamic _defaultValue; @override bool get isNullable => _nullable; @override - IndexType get indexType => _index; + IndexType get indexType => _index!; get defaultValue => _defaultValue; List get externalReferences => new List.unmodifiable(_references); - MigrationColumn(ColumnType type, - {bool isNullable: true, int length, IndexType indexType, defaultValue}) + MigrationColumn(ColumnType? type, + {bool isNullable: true, int? length, IndexType? indexType, defaultValue}) : super(type: type, length: length) { _nullable = isNullable; _index = indexType; @@ -49,11 +49,11 @@ class MigrationColumn extends Column { class MigrationColumnReference { final String foreignTable, foreignKey; - String _behavior; + String? _behavior; MigrationColumnReference._(this.foreignTable, this.foreignKey); - String get behavior => _behavior; + String? get behavior => _behavior; StateError _locked() => new StateError('Cannot override existing "$_behavior" behavior.'); diff --git a/packages/orm/angel_migration/lib/src/table.dart b/packages/orm/angel_migration/lib/src/table.dart index e14cbf6b..28e7ffaa 100755 --- a/packages/orm/angel_migration/lib/src/table.dart +++ b/packages/orm/angel_migration/lib/src/table.dart @@ -29,7 +29,7 @@ abstract class Table { MigrationColumn text(String name) => declare(name, ColumnType.text); - MigrationColumn varChar(String name, {int length}) { + MigrationColumn varChar(String name, {int? length}) { if (length == null) return declare(name, ColumnType.varChar); return declareColumn( name, new Column(type: ColumnType.varChar, length: length)); diff --git a/packages/orm/angel_migration/pubspec.yaml b/packages/orm/angel_migration/pubspec.yaml index 6df20b7a..cd2b2739 100755 --- a/packages/orm/angel_migration/pubspec.yaml +++ b/packages/orm/angel_migration/pubspec.yaml @@ -1,14 +1,13 @@ name: angel_migration -version: 3.0.0 +version: 4.0.0 description: Database migration runtime for Angel's ORM. Use this package to define schemas. -author: Tobe O homepage: https://github.com/angel-dart/migration publish_to: none environment: - sdk: '>=2.10.0 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: angel_orm: git: url: https://github.com/dukefirehawk/angel.git - ref: sdk-2.12.x + ref: sdk-2.12.x_nnbd path: packages/orm/angel_orm \ No newline at end of file