Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ d("migrate-ts lifecycle against real Postgres", () => {
expect(orders1.indexes.some((i) => i.unique && i.columns.includes("email"))).toBe(true);
// enum + numeric checks present
expect(checkExprs(orders1)).toEqual(
["qty >= 1", "status in 'open', 'closed'"].sort(),
["qty >= 1", "status in 'open','closed'"].sort(),
);

// ---- v2: evolve ---------------------------------------------------------
Expand Down Expand Up @@ -189,7 +189,7 @@ d("migrate-ts lifecycle against real Postgres", () => {
expect(orders2.foreignKeys.some((f) => f.refTable === "lc_customers")).toBe(true);
// evolved checks
const c2 = checkExprs(orders2);
expect(c2).toContain("status in 'open', 'closed', 'cancelled'");
expect(c2).toContain("status in 'open','closed','cancelled'");
expect(c2).toContain("qty >= 1 and qty <= 1000");

// ---- rollback v2 → v1 (down) --------------------------------------------
Expand All @@ -203,7 +203,7 @@ d("migrate-ts lifecycle against real Postgres", () => {
expect(colNames(ordersBack)).toEqual(["email", "id", "qty", "status"]); // note/customerId dropped
expect(ordersBack.foreignKeys).toHaveLength(0); // fk dropped
expect(checkExprs(ordersBack)).toEqual(
["qty >= 1", "status in 'open', 'closed'"].sort(), // original checks restored
["qty >= 1", "status in 'open','closed'"].sort(), // original checks restored
);

// ---- idempotency: re-diff v1 against the live (rolled-back) DB ----------
Expand Down Expand Up @@ -326,7 +326,7 @@ d("migrate-ts lifecycle against real Postgres", () => {
expect(posts.foreignKeys.some((f) => f.refTable === "gf_users")).toBe(true);
expect(comments.foreignKeys.map((f) => f.refTable).sort()).toEqual(["gf_posts", "gf_users"]);
// enum + numeric checks + unique indexes survived the round-trip
expect(checkExprs(gf.find((t) => t.name === "gf_users")!)).toContain("role in 'admin', 'editor', 'viewer'");
expect(checkExprs(gf.find((t) => t.name === "gf_users")!)).toContain("role in 'admin','editor','viewer'");
expect(checkExprs(posts).some((e) => e.includes("views >= 0"))).toBe(true);
expect(gf.find((t) => t.name === "gf_tags")!.indexes.some((i) => i.unique && i.columns.includes("name"))).toBe(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const META = JSON.stringify({
"object.entity": {
name: "Reading",
children: [
{ "source.rdb": { "@table": "readings" } },
{ "field.long": { name: "id" } },
// Bug 6 — the scalar @isArray fan-out beyond string/uuid.
{ "field.int": { name: "counts", isArray: true } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const META = JSON.stringify({
"object.entity": {
name: "Endpoint",
children: [
{ "source.rdb": { "@table": "endpoints" } },
{ "field.long": { name: "id" } },
{ "field.inet": { name: "strictIp" } },
{ "field.inet": { name: "lenientIp", "@lenient": true } },
Expand Down
Loading