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

Add basic migration system #42

Merged
merged 21 commits into from
Dec 12, 2022
Merged

Add basic migration system #42

merged 21 commits into from
Dec 12, 2022

Conversation

abulte
Copy link
Contributor

@abulte abulte commented Dec 5, 2022

Pending #29, this allows us to write simple SQL migrations.

The library is unfortunately not published on pypi, but code is clean and simple. This should only be temporary anyway.

I made a small hack with the _LATEST_REVISION file in order to be able to upgrade to the latest revision (sic) without knowing its name.

@abulte abulte requested a review from maudetes December 5, 2022 16:07
Base automatically changed from queue-analysis to main December 6, 2022 13:52
@abulte
Copy link
Contributor Author

abulte commented Dec 7, 2022

@maudetes asyncpg-trek is now on pypi! And I'm an official contributor ;-)

@adriangb
Copy link

adriangb commented Dec 7, 2022

Very cool! I’m curious how you folks feel about the whole “graph of versions” vs linear migrations (hence the {YYYYMMDD}_rev{from}_up_rev{to}.sql syntax). I quite like that the foundation of asyncpg-trek is devoid of restrictive linear representations of migrations, but maybe it makes sense to add a hardcoded pointer to the latest version and a CLI like you have here?

Copy link
Contributor

@maudetes maudetes left a comment

Choose a reason for hiding this comment

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

Nice! I find the usage and the _LATEST_REVISION hack simple enough!

I added a very blocking comment, though :p

README.md Outdated Show resolved Hide resolved
Co-authored-by: maudetes <maudet.estelle@gmail.com>
@abulte
Copy link
Contributor Author

abulte commented Dec 12, 2022

@adriangb I have to admit I've never used a migration system with such a feature, so I'm not sure what use case it could apply to. Maybe ideas will come over time? We're not using it for complicated stuff right now. I don't known if it's linked but your library was by far the simplest (maintained) I've seen. I only had to resort to the _LATEST_REVISION file hack to make it work for us, since I did not want every dev and ops from the team to be aware of this latest revision.

@abulte abulte merged commit e687ee0 into main Dec 12, 2022
@abulte abulte deleted the db-migrations branch December 12, 2022 06:25
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

3 participants