GithubHelp home page GithubHelp logo

sadisms / peewee-moves Goto Github PK

View Code? Open in Web Editor NEW

This project forked from timster/peewee-moves

0.0 0.0 0.0 161 KB

A simple and flexible migration manager for Peewee ORM.

License: MIT License

Python 98.47% Makefile 1.53%

peewee-moves's Introduction

peewee-moves

A simple and flexible migration manager for Peewee ORM.

Build Status Code Coverage Version Downloads Documentation

Requirements

  • python > 3.4, <= 3.8
  • peewee >= 3.0.0
  • click >= 2.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.

peewee-moves's People

Contributors

arnulfojr avatar everhide avatar pylipp avatar revolter avatar sadisms avatar timster avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.