fix(sdk): skip comment-only chunks when splitting migrations

This commit is contained in:
LukeGus committed 2026-10-15 21:52:11 -05:00
1 parent cc5dce18e2
commit d2851982a6
6 files changed
+28 -5

No files matched your search

@@ -308,4 +308,11 @@ describe("adoptTableSql", () => {
const joined = adoptTableSql("sqlite", "fleets", adopted).join("\n");
expect(splitStatements(joined)).toHaveLength(3);
});
it("drops a chunk that is only comments", () => {
expect(splitStatements("-- nothing to do here.\n")).toEqual([]);
expect(
splitStatements("/* note */;\n-- why\nSELECT 1;\n-- trailing"),
).toEqual(["-- why\nSELECT 1"]);
});
});