Septentrion: A CLI tool to apply PostgreSQL migrations to a database¶
Overview¶
Maybe you’re looking for a tool to take care of Database migrations in your project. For Django projects, that tool used to be South and then it became Django itself.
But maybe you’re looking for a tool that just focuses on running existing SQL migrations and keeping track of what was applied. Your tool of choice would not generate those migrations, because you prefer your migrations to be manually written in SQL. Then your tool would be django-north.
But maybe you’re not using Django. You would like a standalone migration tool. You’re looking for Septentrion. Congratulations, you’ve found it.
Septentrion supports PostgreSQL 9.6+ & Python 3.7+, and requires the psql
executable to be present on the system.
Very quick start¶
Step 0: Install with
pip install septentrion[psycopg2_binary]
(orpip install septentrion[psycopg2]
if you know what you’re doing)Step 1: Create a folder for the version, and add some migration files.
migrations/
└── 1.0
├── 1.0-0-version-dml.sql
├── 1.0-author-1-ddl.sql
└── 1.0-author-2-dml.sql
Step 2: Run septentrion
$ septentrion --target-version 1.0 migrate
Step 3: That’s it.
Table of contents¶
- Quickstart
- How-to…
- Discussions
- API Reference
- Glossary
- Contributing
- I want to setup a database for contributing & running tests
- I want to prepare my development environment
- I just want to run the CI checks locally
- I want a venv to play locally
- I want a quicker feedback loop
- I want to build the documentation
- I want to hack around
- I want a working setup to iterate from
- Core contributor additional documentation