diff --git a/packages/orm/angel_migration_runner/lib/src/mariadb/runner.dart b/packages/orm/angel_migration_runner/lib/src/mariadb/runner.dart index 1609a72f..24473657 100644 --- a/packages/orm/angel_migration_runner/lib/src/mariadb/runner.dart +++ b/packages/orm/angel_migration_runner/lib/src/mariadb/runner.dart @@ -71,7 +71,11 @@ class MariaDbMigrationRunner implements MigrationRunner { var curBatch = 0; if (result.isNotEmpty) { var firstRow = result.toList(); - curBatch = int.tryParse(firstRow[0][0] ?? '0') as int; + var firstBatch = firstRow[0][0] ?? 0; + if (firstBatch is! int) { + int.tryParse(firstBatch) as int; + } + curBatch = firstBatch; } var batch = curBatch + 1; @@ -105,7 +109,11 @@ class MariaDbMigrationRunner implements MigrationRunner { var curBatch = 0; if (result.isNotEmpty) { var firstRow = result.toList(); - curBatch = int.tryParse(firstRow[0][0]) as int; + var firstBatch = firstRow[0][0]; + if (firstBatch is! int) { + int.tryParse(firstBatch) as int; + } + curBatch = firstBatch; } result = await connection