kristiandupont / schemalint

Lint database schemas

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hard-coded `schema` on two lines for suggested migration in preferIdentity type rule

eebbesen opened this issue · comments

Text schema is prepended to the DROP SEQUENCE and setval suggestions instead of using ${schemaObject.name} to get the actual schema. The actual schema is used for the ALTER TABLE suggestions.

Here is the output:

ALTER TABLE "public"."days" ALTER "id" DROP DEFAULT;
DROP SEQUENCE "schema"."days_id_seq";
ALTER TABLE "public"."days" ALTER "id" ADD GENERATED BY DEFAULT AS IDENTITY;
SELECT setval('"days_id_seq"', max("id")) FROM "schema"."days";

DROP SEQUENCE "schema"."${sequenceName}";

SELECT setval('"${sequenceName}"', max("${columnName}")) FROM "schema"."${tableName}";`,

I'd be happy to submit a PR for a fix if this is indeed an issue.

Okay, that certainly looks like a bug! I'd be happy to merge your PR if you make one!

This is now published. Thank you so much for contributing, @eebbesen!

My pleasure, thank you for creating this, @kristiandupont. Godt nytår!