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

Initialize migration management #50

Merged
merged 19 commits into from
Feb 4, 2020
Merged

Initialize migration management #50

merged 19 commits into from
Feb 4, 2020

Conversation

rod-glover
Copy link
Contributor

@rod-glover rod-glover commented Jan 28, 2020

Resolves #31

Installs and configures Alembic.
Establishes initial migration from empty schema to populated schema (tables only).
Respects specified schema name.
Establishes migration test framework and first migration tests.

Upcoming migrations will install functions, views, matviews. One thing at a time.

Guide for the perplexed:

  • TL;DR:
    • Review README, alembic/versions/522eed334c85_create_initial_database.py, tests/alembic_migrations/test_migrations.py.
    • The rest is mostly boilerplate.
  • There are several hundred lines of new documentation on Alembic, its configuration in this project, and how to use it in this project.
  • The alembic configuration proper (everything in subdirectory alembic except for alembic/development/, plus alembic.ini) is quite straightforward and pretty much copied from modelmeta.
  • I included a local development database utility (housed in subdirectory alembic/development/) that proved very helpful for coding and testing. It's not central to this PR, but it will continue to be useful.
  • The initial migration (alembic/versions) is straightforward.
  • Writing tests for the migrations that respect schema name specification required modifying some of the utilities provided by alembic-verify and sqlalchemydiff. No big deal, but more code, at present housed in tests/alembic_migrations/alembicverify_util and tests/alembic_migrations/sqlalchemydiff_util.

@rod-glover
Copy link
Contributor Author

@jameshiebert , if you have time for a quick look over this code, that would be great.

@rod-glover
Copy link
Contributor Author

Merging following brief discussion with @jameshiebert

@rod-glover rod-glover merged commit a39fa2c into master Feb 4, 2020
@rod-glover rod-glover deleted the i31-init-alembic branch February 4, 2020 01:32
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.

Initialize migration management
1 participant