Skip to main content

Ascetic database migrations. The most ease way to power your python app with raw database migrations

Project description

Ascetic Migrations

Travis CI status Coveralls status

For my personal projects I’d like to use raw sql migrations. Django for example generates ugly key names: something like: key_number

Installation

Simply run in your bash:

pip install amigrations

Usage

from amigratons import AMigrations

amigrations = AMigrations('mysql://root:123456@localhost:3306/amigrations_test', path_to_folder_with_migrations)
files_created = amigrations.create(migraiton_message)
# files_created is a dictionary with two keys: up and down. If you want immediately update migration content, please
# do following
with files_created['up'].open('w') as fpu, files_created['down'].open('w') as fpd:
    fpu.write('CREATE TABLE test (id int(11) not null AUTO_INCREMENT, PRIMARY KEY(id))')
    fpd.write('drop table test')
# run db upgrade
amigrations.upgrade()
# please pass migration id you want to downgrade to, including
amigrations.downgrade_to(downgrade_to_id)

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

amigrations-0.3.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file amigrations-0.3.tar.gz.

File metadata

  • Download URL: amigrations-0.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for amigrations-0.3.tar.gz
Algorithm Hash digest
SHA256 41424fad2ea1d713f43b8c7b985f630e7ceb4890d1f4ba283dc3d307898c6da6
MD5 dd513936daf5d6244a8c7729d5a41af6
BLAKE2b-256 b2e2eea12277768637bc8dbaf34302bbf2107082bb26e6447edeacc86028376f

See more details on using hashes here.

Supported by

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