Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Schema Evolution for Peewee

Project Description

Diffs your models against your database, and outputs SQL to (non-destructively) update your schema.

Think of it as db.create_tables() on steriods (which doesn’t drop your database).

You can also think of it as schema migrations, without having to actually write the migrations.

Quick Start

  1. Run: sudo pip install peewee-db-evolve
  2. Add import peeweedbevolve anywhere before your models are defined.
  3. Run db.evolve() where you would have normally run db.create_tables(), and enjoy!

Example

See our Hello World example.

image

Supported Databases

  • PostgreSQL
  • MySQL

Frequently Asked Questions

Does this work with existing projects, or only with new projects?

This works very well with existing projects. If your API only works with new projects, you’re probably doing it wrong.

Don’t you give up control by not writing your own migrations?

Managing your schema by writing your own migrations is kind of like managing your source code by writing your own patch files in addition to writing your actual code. A well vetted diff tool is going to be better and faster at it than you.

How old / well vetted is this tool?

This project has been in production use since August 2016. (We switched to Peewee as an ORM.) But it’s a style of schema management I’ve been using for ~10 years now.

Tests

How to run:

$ python test.py PostgreSQL
..............................
----------------------------------------------------------------------
Ran 30 tests in 22.421s

OK
Release History

Release History

This version
History Node

0.6.5

History Node

0.6.4

History Node

0.6.3

History Node

0.6.2

History Node

0.6.1

History Node

0.6.0

History Node

0.5.3

History Node

0.5.2

History Node

0.5.1

History Node

0.5.0

History Node

0.4.9

History Node

0.4.8

History Node

0.4.7

History Node

0.4.6

History Node

0.4.5

History Node

0.4.4

History Node

0.4.3

History Node

0.4.2

History Node

0.4.1

History Node

0.4.0

History Node

0.3.0

History Node

0.2.1

History Node

0.2.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
peewee-db-evolve-0.6.5.tar.gz (9.7 kB) Copy SHA256 Checksum SHA256 Source Oct 17, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting