You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of my node-pg-migrate migrations do not parse the SQL correctly.
馃挃 Your query failed to parse.
This is most likely due to a SQL syntax error. However, you might also have hit a bug, or an unimplemented feature of pg-mem.
If this is the case, please file an issue at https://github.com/oguimbal/pg-mem along with a query that reproduces this syntax error.
馃憠 Failed query:
CREATE TABLE "partner_referral_agreement" (
"partner_referral_agreement_id" text PRIMARY KEY NOT NULL,
"partner_id" text NOT NULL REFERENCES "partner",
"promo_code" text NOT NULL,
"created_at" timestamptz NOT NULL,
"created_by" text NOT NULL,
"valid_from" timestamptz NOT NULL,
"valid_to" timestamptz,
"cancelled_at" timestamptz,
"cancelled_by" text,
"payable_amount" numeric(6, 2) NOT NULL
);
COMMENT ON COLUMN "partner_referral_agreement"."created_by" IS $pga$The person who input the agreement.$pga$;
COMMENT ON COLUMN "partner_referral_agreement"."cancelled_by" IS $pga$The person who cancelled the agreement.$pga$;
COMMENT ON COLUMN "partner_referral_agreement"."payable_amount" IS $pga$positive for payable TO partner, negative for payable TO Amber$pga$;;
馃拃 Syntax error at line 3 col 50:
1 COMMENT ON COLUMN "partner_referral_agreement"."created_by" IS $pga$The person who input the agreement.$pga$;
2 COMMENT ON COLUMN "partner_referral_agreement"."cancelled_by" IS $pga$The person who cancelled the agreement.$pga$;
3 COMMENT ON COLUMN "partner_referral_agreement"."payable_amount" IS $pga$positive for payable TO partner, negative for payable TO Amber$pga$;;
^
Unexpected comma token: ",". Instead, I was expecting to see one of the following:
- A "dot" token
- A "lparen" token
at parseSql (node_modules/pg-mem/src/parser/parse-cache.ts:55:15)
at DbSchema.parse (node_modules/pg-mem/src/schema/schema.ts:93:28)
at DbSchema.queries (node_modules/pg-mem/src/schema/schema.ts:103:31)
at queries.next (<anonymous>)
at DbSchema.query (node_modules/pg-mem/src/schema/schema.ts:79:20)
at MemPg.query (node_modules/pg-mem/src/adapters/adapters.ts:104:76)
at Object.query (node_modules/node-pg-migrate/dist/db.js:38:33)
(nb: the version in your package.json version is often not precise enough... please run "cat ./node_modules/pg-mem/package.json | grep version" to tell which minor version is actually installed)
The text was updated successfully, but these errors were encountered:
timlesallen
changed the title
Query from node-pg-migrate that won't parse - REFERENCES?
Query from node-pg-migrate that won't parse - REFERENCES
Jan 4, 2024
Describe the bug
One of my node-pg-migrate migrations do not parse the SQL correctly.
To Reproduce
pg-mem version
2.7.4
(nb: the version in your package.json version is often not precise enough... please run "cat ./node_modules/pg-mem/package.json | grep version" to tell which minor version is actually installed)
The text was updated successfully, but these errors were encountered: