An idea on DB migration

2007-07-04 Thread Noam
Hello, I have an idea on how DB migration can work in Django. It's very simple, it will allow the programmer to do anything he wants in the migration, and he will have to learn almost nothing in order to migrate the DB. The drawback is that it's not very efficient, which means that it will probab

Re: An idea on DB migration

2007-07-04 Thread Carl Karsten
Noam wrote: > For example, say that I have a directory with the old site (and old > models) and a directory with the new site. The only difference between > them is that I renamed the field store.Book.name to > store.Book.book_name. I will run "django-admin.py migrate oldsitedir > newsitedir". Th

Re: An idea on DB migration

2007-07-04 Thread nick feng
The django has already provided the way to use SQL, I don't think this is needed. - Original Message - From: "Noam" <[EMAIL PROTECTED]> To: "Django users" Sent: Thursday, July 05, 2007 2:40 AM Subject: An idea on DB migration > > > Hello, >

Re: An idea on DB migration

2007-07-04 Thread Noam Raphael
On 7/4/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > > I don't like the "edit the file" part. I can think of 2 alternatives: > > 1. add an attribute to one/both of the models. something like > > class Book(models.Model): > name = models.CharField(blank=True, "migrate_to"="book_name" ) > > 2

Re: An idea on DB migration

2007-07-04 Thread Noam Raphael
On 7/4/07, nick feng <[EMAIL PROTECTED]> wrote: > The django has already provided the way to use SQL, I don't think this is > needed. Well, I'm not a SQL expert, and I don't feel comfortable with adding fields manually. I'm never sure whether my SQL statement is what Django would have issued whe

Re: An idea on DB migration

2007-07-04 Thread Carl Karsten
Noam Raphael wrote: > On 7/4/07, Carl Karsten <[EMAIL PROTECTED]> wrote: >> I don't like the "edit the file" part. I can think of 2 alternatives: >> >> 1. add an attribute to one/both of the models. something like >> >> class Book(models.Model): >> name = models.CharField(blank=True, "migra

Re: An idea on DB migration

2007-07-04 Thread Noam Raphael
On 7/4/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > > The problem I see is maintaining the generated file. This process will often > start before the target system is stable, so as soon as you start making > changes > to the target model, the converter will need to be updated too. If the > tra

Re: An idea on DB migration

2007-07-05 Thread SmileyChris
If you haven't already, check out http://www.aswmc.com/dbmigration/ It's quite a good solution for migration. I've been writing a wrapper on top of that to handle auto-migration, which I'm mostly happy with. Just have to tie some loose ends and I'll put it up somewhere to share. --~--~-

Re: An idea on DB migration

2007-07-05 Thread Noam Raphael
On 7/6/07, SmileyChris <[EMAIL PROTECTED]> wrote: > > If you haven't already, check out http://www.aswmc.com/dbmigration/ > > It's quite a good solution for migration. > I've been writing a wrapper on top of that to handle auto-migration, > which I'm mostly happy with. Just have to tie some loose