A simple migrator with no bs.
Project description
Simple Migrator
A simple tool written in python to run simple migrations.
Basic Usage
1. Setup
simple_migrator setup {DATABASE_URL}
2. Create
simple_migrator create {MIGRATION_NAME}
3. Apply
i. There are two ways to apply the migration. One way is to apply all the latest pending migrations.
simple_migrator up
ii. Another way to do this is to give the files name to the up command.
Note that this method will rerun the given migrations file.
simple_migrator up --files 1703509439.048595_temp
3. Rollback
i. Similar to "up" migration there are two ways to do this
simple_migrator down
ii. Another way to do this is to give the files name to the up command.
Note that this method will rollback every migration no matter if they were applied or not.
simple_migrator down --files 1703509439.048595_temp
4. List
i. List All This will list all the migrations present.
simple_migrator list all
ii. List All Applied This will list all the migrations present.
simple_migrator list applied
iii. List All Applied This will list the last applied migrations.
simple_migrator list last-applied
iv. List Pending This will list the all the pending migrations.
simple_migrator list pending
Setup your project
TDOD:
- Make it so that the project does not reset when the setup is called twice.(There must be a better way).
- Add tests to ensure that it works.
- Add a decorator so that we can check if setup is correctly done and exists gracefully.
- Make sql errors more visible.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for simple_migrator-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79a1e05a89e1b2b70166d2fd18d6050f4e4948de5721df549a591383b637a813 |
|
MD5 | 6607a79a8f2431c99fcbea35bb8a101c |
|
BLAKE2b-256 | 092de94f493f0f576737338025263e0e385141ab9b0f84ad7ea9b63c9c38a155 |