Simple and flexible migration manager for Peewee ORM.
Project description
# Peewee Moves
A simple and flexible migration manager for [Peewee ORM](http://docs.peewee-orm.com/en/stable/).
## Requirements
- Python 3 or later
- Peewee 2.8.0 or later
## 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
created migration 0001_create_table_category
$ ./manage.py db revision -n "do something"
created migration 0002_do_something
$ ./manage.py db upgrade
0001_create_table_category: upgrade
0002_do_something: upgrade
$ ./manage.py db downgrade
0002_do_something: downgrade
$ ./manage.py db status
0001_create_table_category: applied
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!
```python
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](USAGE.md) for more details.
## Todo
- Better command line usage without Flask
- More documentation
- More examples
- Maybe some tests, if I get around to it
## 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.
A simple and flexible migration manager for [Peewee ORM](http://docs.peewee-orm.com/en/stable/).
## Requirements
- Python 3 or later
- Peewee 2.8.0 or later
## 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
created migration 0001_create_table_category
$ ./manage.py db revision -n "do something"
created migration 0002_do_something
$ ./manage.py db upgrade
0001_create_table_category: upgrade
0002_do_something: upgrade
$ ./manage.py db downgrade
0002_do_something: downgrade
$ ./manage.py db status
0001_create_table_category: applied
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!
```python
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](USAGE.md) for more details.
## Todo
- Better command line usage without Flask
- More documentation
- More examples
- Maybe some tests, if I get around to it
## 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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for peewee_moves-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23f7a937cbaf8c77b84385ef1753832bf069f438e6383e4b5ac601da999a1912 |
|
MD5 | 783c7a95cb3457cf5e1372d994283c06 |
|
BLAKE2b-256 | 80c7a5d58f7e499a65f59426a3a4703d3ffe2bf4a3064fb2e63c23dec840d447 |