Skip to main content

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

simple_migrator-0.1.7.tar.gz (30.9 kB view hashes)

Uploaded Source

Built Distribution

simple_migrator-0.1.7-py3-none-any.whl (11.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page