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

Enable to drop a column even if there is similar column in other schema #193

Merged
merged 2 commits into from
Jan 24, 2022

Conversation

yuku
Copy link
Contributor

@yuku yuku commented Jan 24, 2022

Suppose there are two similar tables in two schemas:

create table user.accounts (id int);
create table bank.accounts (id int);

If we drop a column from a table:

create table user.accounts (id int);
create table bank.accounts ();

psqldef generates duplicated drop column:

-- Apply --
ALTER TABLE "bank"."accounts" DROP COLUMN "id";
ALTER TABLE "bank"."accounts" DROP COLUMN "id";

This PR fixes the issue.

@yuku yuku changed the title Enable to drop a column even if there is similar column in another schema Enable to drop a column even if there is similar column in other schema Jan 24, 2022
@yuku yuku marked this pull request as ready for review January 24, 2022 13:04
@yuku
Copy link
Contributor Author

yuku commented Jan 24, 2022

@k0kubun Could you review this PR? 🙏

Copy link
Collaborator

@k0kubun k0kubun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🙏

@k0kubun k0kubun merged commit a29d399 into sqldef:master Jan 24, 2022
@yuku yuku deleted the drop-column branch August 25, 2022 13:07
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

Successfully merging this pull request may close these issues.

None yet

2 participants