Add support for database modifications
Yep, I agree that would be nice.  I'm working on refactoring the way DDL is generated currently -- would like to get that in place and probably build any schema changing stuff on top of it.
 Sweet.

Thanks for making peewee awesome!

On Fri, Feb 8, 2013 at 3:15 PM, Charles Leifer notifications@github.comwrote:

> Yep, I agree that would be nice. I'm working on refactoring the way DDL is
> generated currently -- would like to get that in place and probably build
> any schema changing stuff on top of it.
> 
> —
> Reply to this email directly or view it on GitHubhttps://github.com/coleifer/peewee/issues/162#issuecomment-13319239..

## 

Daniel Hobe hobe@gmail.com
 I try!  I will update this ticket with progress
 So I have made two or three attempts at creating a nice API for representing DDL and every time it feels more cumbersome and clunky than just writing the `create` statements by hand.  I may have to scale back my goal and just try to provide a nice api for doing basic schema changes.  Proposals are welcome
 Added some stuff in 180bf0b8e0dd22e87b216c59de4da68aa2ed1683 with some basic postgresql support.

SQLite doesn't handle much more than adding columns, and MySQL uses a completely different syntax than Postgresql.  Maybe this code could be refactored or retooled into something usable on different backends.  For sqlite it will be necessary to create temp tables and rename rather than altering or dropping columns, since this is not supported.
 Cool, I'll take a look.

I've looked into how a few other orms deal with this and it does seem like
each db driver has to support their own thing.

On Sun, Mar 17, 2013 at 8:46 PM, Charles Leifer notifications@github.comwrote:

> Added some stuff in 180bf0bhttps://github.com/coleifer/peewee/commit/180bf0b8e0dd22e87b216c59de4da68aa2ed1683with some basic postgresql support.
> 
> SQLite doesn't handle much more than adding columns, and MySQL uses a
> completely different syntax than Postgresql. Maybe this code could be
> refactored or retooled into something usable on different backends. For
> sqlite it will be necessary to create temp tables and rename rather than
> altering or dropping columns, since this is not supported.
> 
> —
> Reply to this email directly or view it on GitHubhttps://github.com/coleifer/peewee/issues/162#issuecomment-15037985
> .

## 

Daniel Hobe hobe@gmail.com

I'd like to implement some sort of schema migration support for the app I'm working on.  It would be awesome if Peewee could support some of the basic modifications people would want to do.

Things like:
- add, rename and remove columns
- add and remove indexes (it already supports add I think)
- alter column defaults, NOT NULL etc

My pony request would be to have a standard peewee way of doing this ala the ruby ActiveRecord migrations or something like that.
