Skip to main content

Simple and flexible migration manager for Peewee ORM.

Project description

A simple and flexible migration manager for Peewee ORM.

Build Status Code Coverage Version Downloads Documentation

Requirements

  • python >= 3.4, <= 3.6
  • peewee >= 3.0.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:

$ export FLASK_APP=myflaskapp

$ flask db create app.models.Category
INFO: created migration 0001_create_table_category

$ flask db revision "do something"
INFO: created migration 0002_do_something

$ flask db upgrade
INFO: 0001_create_table_category: upgrade
INFO: 0002_do_something: upgrade

$ flask db downgrade
INFO: 0002_do_something: downgrade

$ flask 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')

Documentation

Check out the Full Documentation for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for peewee-moves, version 2.0.1
Filename, size File type Python version Upload date Hashes
Filename, size peewee_moves-2.0.1-py2.py3-none-any.whl (11.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size peewee-moves-2.0.1.tar.gz (10.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page