Simple and flexible migration manager for Peewee ORM.
Project description
A simple and flexible migration manager for Peewee ORM.
Requirements
python >= 3.3
peewee >= 2.8.0
Installation
This package can be installed using pip:
pip install peewee-moves
Usage
Here’s a quick teaser of what you can do with peewee-moves:
$ ./manage.py db create -m app.models.Category
INFO: created migration 0001_create_table_category
$ ./manage.py db revision -n "do something"
INFO: created migration 0002_do_something
$ ./manage.py db upgrade
INFO: 0001_create_table_category: upgrade
INFO: 0002_do_something: upgrade
$ ./manage.py db downgrade
INFO: 0002_do_something: downgrade
$ ./manage.py db status
INFO: 0001_create_table_category: applied
INFO: 0002_do_something: pending
And if you’re curious, here’s what 0001_create_table_category.py looks like. A migration was automatically created based on the definition of the Category model!
def upgrade(migrator):
with migrator.create_table('category') as table:
table.primary_key('id')
table.integer('code', unique=True)
table.string('name', max_length=250)
def downgrade(migrator):
migrator.drop_table('category')
Check out the Usage documentation for more details.
Todo
Command line usage without Flask
More documentation
More examples
More tests
Feedback
This package is very immature. If you have any comments, suggestions, feedback, or issues, please feel free to send me a message or submit an issue on Github.
Project details
Release history Release notifications | RSS feed
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 peewee_moves-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18ebd423c97be4eedee1d6329a52bada53aafe239b849114993a69be5b08375e |
|
MD5 | 3d48d1830ee677efb4abf6ef80e5189c |
|
BLAKE2b-256 | f2d0265b17e3f129873f758b843c2037c1eb785a7e0a8e122d9ff76ac7094ddb |