Changing database fields

2 views
Skip to first unread message

Oleg Oltar

unread,
Jan 28, 2009, 4:29:46 PM1/28/09
to django...@googlegroups.com
Hi!

I am creating my first application. Which is to be a small publishing system. 

I defined a model, which represent a single article, and also added about 15 articles to my database (which is sqlite3).

Now I understand that I should extend my models with few more fields (e.g. need to add categories and date_published). I thought that can simply 
add those to my models, but then realized that I need to modify already created fields...

Is there a common practice to do it? Maybe some recipe? 

Thanks,
Oleg  

Mark Jones

unread,
Jan 28, 2009, 4:53:12 PM1/28/09
to Django users
This is where Rails rocks and DJango doesn't. I haven't been able to
find any kind of DB Migrations in Django like those in Rails. Sad
too, because other than that, Python is a lot nicer than Ruby (Syntax
wise for an old C++ programmer)

Karen Tracey

unread,
Jan 28, 2009, 5:02:59 PM1/28/09
to django...@googlegroups.com

Django has nothing built in for this.  There are, instead, multiple different external projects that aim to provide this function. See:

http://groups.google.com/group/django-developers/browse_thread/thread/a4f1040210d5887f/18d949dc6987ed3a

which is the discussion thread associated with the announcement of the last one of these I recall hearing about, and I think it has pointers to where you can find out more about the other ones.  Long-term it would be nice if Django incorporated something along these lines in the base, and I believe many of the people involved in these projects want that to happen, but there is work to be done to agree on what features, etc. from each should be supported, and that hasn't been settled yet.  In the meantime there are solutions available, you just have to do a bit of research to figure out which of them best meets your needs.

Karen

Russell Keith-Magee

unread,
Jan 28, 2009, 6:04:20 PM1/28/09
to django...@googlegroups.com
On Thu, Jan 29, 2009 at 6:53 AM, Mark Jones <Mark...@gmail.com> wrote:
>
> This is where Rails rocks and DJango doesn't. I haven't been able to
> find any kind of DB Migrations in Django like those in Rails. Sad
> too, because other than that, Python is a lot nicer than Ruby (Syntax
> wise for an old C++ programmer)

Consider it a work in progress. There are several external projects
working on this:

http://code.google.com/p/django-evolution/
http://code.google.com/p/dmigrations/
http://south.aeracode.org/
http://www.bitbucket.org/DeadWisdom/migratory/
http://code.google.com/p/deseb/

In addition, the creators of the first 3 of these projects featured in
a panel discussion at DjangoCon 2008:

http://www.youtube.com/watch?v=VSq8m00p1FM

Following that meeting, they (that is, Simon Willison, Andrew Godwin
and myself) started a SIG:

http://code.google.com/p/django-migrations-sig/

with the aim of getting "the one true migration framework" into the
Django core as a contrib package. Progress on the SIG has stalled -
mostly due to other commitments, like getting features ready for
Django v1.1. However, I have hopes that we can resurrect the
discussion for the v1.2/v1.3 timeframe.

Yours,
Russ Magee %-)

Reply all
Reply to author
Forward
0 new messages