schultek/stormberry

Build runner error when attempting to generate simple one-to-many relationship

kylehayes opened this issue · 2 comments

A simple reproducible example is:

@Model()
abstract class Foo {
  @PrimaryKey()
  String get id;
  List<Bar> get bars;
}

@Model()
abstract class Bar {
  @PrimaryKey()
  String get id;
}

This results in the following build_runner error:

Failed to build database schema:

type 'ReferenceColumnBuilder' is not a subtype of type 'ForeignColumnBuilder' of 'value'

Strange that this wasn't catched before, I'll look into it.

Should be fixed on main. Before I release can you test with:

dependency_overrides:
  stormberry:
    git: github.com/schultek/stormberry