Alembic - sgml/signature GitHub Wiki
Localhost
To copy new data to the local db instance:
- Rename the tables that have the old data
- Copy the table you need from develop
- Copy the tables which have the foreign keys you need
- Test with the new data
Tutorials
- https://github.com/sqlalchemy/alembic/blob/main/docs/build/cookbook.rst#run-multiple-alembic-environments-from-one-ini-file
- https://medium.com/the-andela-way/alembic-how-to-add-a-non-nullable-field-to-a-populated-table-998554003134
- https://python.hotexamples.com/examples/alembic.op/-/create_unique_constraint/python-create_unique_constraint-function-examples.html
- https://www.kimsereylam.com/sqlalchemy/2019/10/18/get-started-with-alembic.html
- https://docs.securedrop.org/en/latest/development/database_migrations.html
- https://blog.jerrycodes.com/multiple-heads-in-alembic-migrations/
- https://gist.github.com/killerswan/22a0d7f93935d26d3b8d
- https://petegraham.co.uk/rename-postgres-table-with-alembic/
- https://www.compose.com/articles/schema-migrations-with-alembic-python-and-postgresql/
- https://jamaicandevelopers.com/p/create-a-database-migration-script-for-kotti
- https://blog.miguelgrinberg.com/post/resolving-database-schema-conflicts
- https://wiki.asterisk.org/wiki/display/AST/Merging+alembic+scripts
References
- https://buildmedia.readthedocs.org/media/pdf/alembic/rel_0_7/alembic.pdf
- https://alembic.sqlalchemy.org/en/latest/api/commands.html
- https://alembic.sqlalchemy.org/en/latest/api/config.html
- http://manpages.ubuntu.com/manpages/bionic/man1/alembic.1.html
- https://github.com/sqlalchemy/alembic/blob/master/alembic/config.py
- https://github.com/sqlalchemy/alembic/blob/master/docs/build/branches.rst
- https://alembic.sqlalchemy.org/en/latest/ops.html
- https://alembic.sqlalchemy.org/en/latest/api/commands.html?highlight=heads#alembic.command.heads
- https://alembic-offline.readthedocs.io/en/latest/
- https://docs.makotemplates.org/en/latest/defs.html
QA
- https://stackoverflow.com/questions/48242324/undo-last-alembic-migration
- https://stackoverflow.com/questions/33705697/alembic-integrityerror-column-contains-null-values-when-adding-non-nullable
- https://stackoverflow.com/questions/44631175/alembic-how-to-alter-a-foreigenkey-column/44632927#44632927
- https://news.ycombinator.com/item?id=19880334