I made an oopsie
try repo.createTable(
"foo",
&.{
t.primaryKey("id", .{}),
t.column("name", .string, .{ .index = true }),
t.column("prefix", .string, .{ .index = true }),
t.timestamps(.{}),
},
.{},
);
try repo.createTable(
"bar",
&.{
t.primaryKey("id", .{}),
t.column("number", .string, .{ .index = true }),
t.column(
"foo",
.integer,
.{ .reference = .{ "foo", "id" } },
),
t.timestamps(.{}),
},
.{},
);
The generated Schema.zig then ended up creating Bar with a .relations that had a .foo as well as having a foo that was part of the object, when it should have been foo_id, and that caused the following error when I tried to do a query that called include
error: duplicate struct field name foo