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

Sort table column definitions alphabetically #11

Merged
merged 2 commits into from
Jul 1, 2019
Merged

Sort table column definitions alphabetically #11

merged 2 commits into from
Jul 1, 2019

Conversation

RKushnir
Copy link
Contributor

When developers simultaneously work on the tasks that require new columns in the database,
it's possible that their local databases will end up with columns being added in different order, leading to inconsistent database structure dumps.

By sorting the columns alphabetically we enforce the same order for everyone, keeping the file consistent.

@lfittl
Copy link
Owner

lfittl commented Dec 19, 2018

@RKushnir Nice idea!

Sometimes there is a benefit to certain alignments in Postgres (i.e. column order matters), so if someone bootstraps a production database from the db/structure.sql at some point, they may get sub-optimal results.

Maybe we can make this an opt-in setting somehow?

@RKushnir
Copy link
Contributor Author

Hi @lfittl Yes, I was thinking about that. We could introduce a configuration object to turn this on/off. I'll update my PR with that. Should it be enabled by default?

@RKushnir
Copy link
Contributor Author

@lfittl I added the configuration boilerplate and a setting for this feature, which is disabled by default.

@RKushnir
Copy link
Contributor Author

RKushnir commented Jan 8, 2019

@lfittl Is there anything else I need to do for this? It would be great to finish it while it's still fresh in memory.

@lfittl
Copy link
Owner

lfittl commented May 7, 2019

@RKushnir Apologies for the very delayed response on this!

Could you rebase the configuration option on the approach that is now in master?

@RKushnir
Copy link
Contributor Author

RKushnir commented May 9, 2019

Hi @lfittl Done. Please, have a look.

@lfittl lfittl merged commit d77d2b3 into lfittl:master Jul 1, 2019
@lfittl
Copy link
Owner

lfittl commented Jul 1, 2019

@RKushnir Merged - sorry for the long wait!

@RKushnir RKushnir deleted the sort-columns branch July 1, 2019 09:01
@RKushnir
Copy link
Contributor Author

RKushnir commented Jul 1, 2019

Thanks, @lfittl ! 🎉 I'm glad we can now remove this patch from our code.

@RKushnir
Copy link
Contributor Author

@lfittl Can we have a new release, tho?

@lfittl
Copy link
Owner

lfittl commented Aug 27, 2019

@RKushnir Released 0.4.0 today - thanks for the reminder!

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.

2 participants