mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 22:25:24 +00:00
fix(sdk): skip comment-only chunks when splitting migrations
This commit is contained in:
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"]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user