Skip to content
This repository was archived by the owner on Mar 18, 2021. It is now read-only.
This repository was archived by the owner on Mar 18, 2021. It is now read-only.

db generate. The getter 'length' was called on null. #862

@sorgfal

Description

@sorgfal

Hi this error happens when i try to execute db generate, with existed migration file.
If i delete first migration, new migration will be generated normally.

MacBook-Pro-MacBook:pinta_server pro$ aqueduct db generate -- Aqueduct CLI Version: 4.0.0-b1 -- Aqueduct project version: 4.0.0-b1 Replaying versions: 1... *** Uncaught error Bad state: NoSuchMethodError: The getter 'length' was called on null. Receiver: null Tried calling: length **** Stacktrace
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1 _ClassMirror.newInstance (dart:mirrors-patch/mirrors_impl.dart:653:44)
#2 Executable.instanceOf (<data:application/dart>:15:813)
#3 SchemaBuilderExecutable.execute (<data:application/dart>:14:873)
#4 main (<data:application/dart>:10:35)
#5 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:32)
#6 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

Now my migrations folder look like
migrations/
00000001_initial.migration.dart

00000001_initial.migration.dart
class Migration1 extends Migration {
@override
Future upgrade() async { database.createTable(SchemaTable("stores", [SchemaColumn("id", ManagedPropertyType.integer, isPrimaryKey: true, autoincrement: true, isIndexed: false, isNullable: false, isUnique: false),SchemaColumn("title", ManagedPropertyType.string, isPrimaryKey: false, autoincrement: false, isIndexed: false, isNullable: false, isUnique: false)])); }

@override Future downgrade() async {}

@override Future seed() async {}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions