Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
eebbesen opened this issue Dec 30, 2023 · 3 comments

Comments

@eebbesen
Copy link
Contributor

eebbesen commented Dec 30, 2023

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.

@eebbesen eebbesen changed the title Hard-coded schema on two lines in suggested migration in preferIdentity type rule Hard-coded schema on two lines for suggested migration in preferIdentity type rule Dec 30, 2023
@kristiandupont
Copy link
Owner

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

@kristiandupont
Copy link
Owner

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

@eebbesen
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants