dmigrations
flag
Messages 1 - 10 of 13 - Collapse all
/groups/adfetch?adid=QIP4MREAAAAPTOAq2Y5V9cd4rYlyrXRiFSRgCP-avRN4YT0eROC0jw
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
1.  Trey Piepmeier  
View profile  
 More options Sep 3 2008, 3:16 pm
From: Trey Piepmeier <tpiepme...@gmail.com>
Date: Wed, 3 Sep 2008 12:16:22 -0700 (PDT)
Local: Wed, Sep 3 2008 3:16 pm
Subject: dmigrations
Simon Willison (one of the creators of Django) just released a new
database migration tool for Django called dmigrations:
http://simonwillison.net/2008/Sep/3/dmigrations/

It's still not as nice as what's built into Rails, in my opinion. I'd
prefer to have the migration files be written in Python (as opposed to
raw SQL), like Rails migration files are written in Ruby. This looks
like it's probably better than any other option available for Django
right now.

Have any of you used any migration tool in Django?

South: http://south.aeracode.org/
django-evolution: http://code.google.com/p/django-evolution/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
2.  Patrick Altman  
View profile  
 More options Sep 3 2008, 3:53 pm
From: Patrick Altman <palt...@gmail.com>
Date: Wed, 3 Sep 2008 14:53:49 -0500
Local: Wed, Sep 3 2008 3:53 pm
Subject: Re: dmigrations
I ended up rolling my own and it has been working fairly well:
http://paltman.com/2008/07/03/managing-database-changes-in-django/

It was less code/effort than researching all the available ones out  
there as I knew what I wanted to accomplish.

Since doing this, haven't had enough "pain level" to look at some of  
the other solutions.

Unlike you, Trey, I prefer to write the migrations in SQL instead of  
Python for a couple of reasons.  The primary of these reasons is that  
not all migrations are simple DDL changes. Sometimes there is the need  
to fix or otherwise manipulate data well, and it just feels as if you  
get a lot more control when writing in a language that the database  
understands.

On Sep 3, 2008, at 2:16 PM, Trey Piepmeier wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
3.  Trey Piepmeier  
View profile  
 More options Sep 3 2008, 4:02 pm
From: Trey Piepmeier <tpiepme...@gmail.com>
Date: Wed, 3 Sep 2008 13:02:50 -0700 (PDT)
Local: Wed, Sep 3 2008 4:02 pm
Subject: Re: dmigrations

> to fix or otherwise manipulate data well, and it just feels as if you  
> get a lot more control when writing in a language that the database  
> understands.

I can dig that, but I like the idea of having everything be database
agnostic.  I might want to develop a site using SQLite and then move
to MySQL in production.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
4.  Freddie Palmer  
View profile  
 More options Sep 3 2008, 4:17 pm
From: "Freddie Palmer" <fred.pal...@gmail.com>
Date: Wed, 3 Sep 2008 15:17:06 -0500
Local: Wed, Sep 3 2008 4:17 pm
Subject: Re: dmigrations
Just my 2 centavos :)

If you ever think you are going to move to MySql just use it from the
get-go.  You could be setting yourself up for some pain later on.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
5.  Simon Willison  
View profile  
 More options Sep 3 2008, 4:24 pm
From: Simon Willison <si...@simonwillison.net>
Date: Wed, 3 Sep 2008 13:24:41 -0700 (PDT)
Local: Wed, Sep 3 2008 4:24 pm
Subject: Re: dmigrations

Trey Piepmeier wrote:
> It's still not as nice as what's built into Rails, in my opinion. I'd
> prefer to have the migration files be written in Python (as opposed to
> raw SQL), like Rails migration files are written in Ruby. This looks
> like it's probably better than any other option available for Django
> right now.

Hello,

The migrations are written in Python, to a certain extent. Here's a
migration that adds an index to a table:

from dmigrations.mysql import migrations as m
import datetime
migration = m.AddIndex('sessions', 'session', 'expire_date')

AddIndex is a class that "knows" the SQL for adding an index.
AddColumn, DropColumn and DropIndex are others. I'm hoping that people
will write more migration classes for other common operations.

Note that table creation still uses a raw SQL migration rather than a
AddTable class. This was just the simplest thing to do when the
migration system was first written; I certainly wouldn't oppose
creating a more Pythonic abstraction, and doing so would not require
any changes to dmigrations as it exists now. The only contract it
expects is that a migration is an object with an up() and a down()
method.

Hope that clears things up a bit, and sorry for the group invasion!

Cheers,

Simon


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
6.  Trey Piepmeier  
View profile  
 More options Sep 3 2008, 4:38 pm
From: Trey Piepmeier <tpiepme...@gmail.com>
Date: Wed, 3 Sep 2008 13:38:49 -0700 (PDT)
Local: Wed, Sep 3 2008 4:38 pm
Subject: Re: dmigrations
Simon,

Thanks for the input.  That makes sense.

So basically, there are parts that are already abstracted to Python,
but not all of it yet.  And as more abstractions are added, they will
be usable as-is with the API.

Thanks for your work on this and Django in general.  I hope this
thread didn't come off as too negative, I just like to wax
philosophical on the differences between the popular frameworks! :)

-Trey

On Sep 3, 3:24 pm, Simon Willison <si...@simonwillison.net> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
7.  Simon Willison  
View profile  
 More options Sep 3 2008, 5:04 pm
From: Simon Willison <si...@simonwillison.net>
Date: Wed, 3 Sep 2008 14:04:13 -0700 (PDT)
Local: Wed, Sep 3 2008 5:04 pm
Subject: Re: dmigrations
On Sep 3, 9:38 pm, Trey Piepmeier <tpiepme...@gmail.com> wrote:

> Thanks for your work on this and Django in general.  I hope this
> thread didn't come off as too negative, I just like to wax
> philosophical on the differences between the popular frameworks! :)

Not at all. Rails migrations are definitely much more mature - they've
been solving the problem really well for years now. dmigrations is
baby steps at the moment, but it's proved itself in production with a
reasonably large team. And like you said, I'm keen on getting basic
framework right in a way that's extensible. I have high hopes for the
discussion about this stuff at DjangoCon in a few days time.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
8.  George Titsworth  
View profile  
 More options Sep 3 2008, 5:30 pm
From: "George Titsworth" <titswo...@gmail.com>
Date: Wed, 3 Sep 2008 16:30:57 -0500
Local: Wed, Sep 3 2008 5:30 pm
Subject: Re: dmigrations

So what is everyone's opinion on dmigrations vs. django-evolutions vs.
whatever the hell rails does.  I personally don't like having to
individually declare each database change in dmigrations.  I like that
django-evolutions will auto detect what is needed.  However, I like the
sequential migration process that dmigrations sets up and how it allows you
to unapply your migrations.  I am not sure if django-evolutions allows this
or not.

I'm sure a wrapper could be implemented around dmigrations to do the
autodetection of changes and go ahead and create the migrations, at least on
request.  Something like:

./manage.py dmigrate autogenerate

That spits out a few migrations, maybe one for each table that is changing
in some way.

Admittedly I haven't used either.  The only django project I have worked on
had already been designed and I just blindly copied the design and haven't
changes my models since.  But we are in the process of redesigning and I
expect I will definately run into a case in which I will need to use one of
these tools.  So I am eager to hear about real life success/failure stories
with each of these.

Side question: Simon said this was going to be a panel topic at
Django-Con... were they planning on live casting anything or just doing the
normal slideshare approach?

George


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
9.  Simon Willison  
View profile  
 More options Sep 3 2008, 5:35 pm
From: Simon Willison <si...@simonwillison.net>
Date: Wed, 3 Sep 2008 14:35:30 -0700 (PDT)
Local: Wed, Sep 3 2008 5:35 pm
Subject: Re: dmigrations
On Sep 3, 10:30 pm, "George Titsworth" <titswo...@gmail.com> wrote:

> So what is everyone's opinion on dmigrations vs. django-evolutions vs.
> whatever the hell rails does.  I personally don't like having to
> individually declare each database change in dmigrations.  I like that
> django-evolutions will auto detect what is needed.  However, I like the
> sequential migration process that dmigrations sets up and how it allows you
> to unapply your migrations.  I am not sure if django-evolutions allows this
> or not.

> I'm sure a wrapper could be implemented around dmigrations to do the
> autodetection of changes and go ahead and create the migrations, at least on
> request.  Something like:

> ./manage.py dmigrate autogenerate

I would absolutely love this to be the case. I'm looking forward to
talking this over with the django-evolution people at DjangoCon - my
requirements for a migration system are that all changes are
explicitly defined in a file somewhere and I can go both up() and
down(), but if something can mostly automate the process of creating
those migration scripts I'm all for it. django-evolution gets most of
the way there; if it could support manual migration scripts ala
dmigrations there would be no reason for dmigrations to exist at all.

> Side question: Simon said this was going to be a panel topic at
> Django-Con... were they planning on live casting anything or just doing the
> normal slideshare approach?

As far as I know the plan is to video every single session, and share
the video online as soon as possible after the event.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
10.  Andreas  
View profile  
 More options Sep 3 2008, 6:35 pm
From: Andreas <andrii...@gmail.com>
Date: Wed, 3 Sep 2008 15:35:50 -0700 (PDT)
Local: Wed, Sep 3 2008 6:35 pm
Subject: Re: dmigrations

> I would absolutely love this to be the case. I'm looking forward to
> talking this over with the django-evolution people at DjangoCon - my
> requirements for a migration system are that all changes are
> explicitly defined in a file somewhere and I can go both up() and
> down(), but if something can mostly automate the process of creating
> those migration scripts I'm all for it. django-evolution gets most of
> the way there; if it could support manual migration scripts ala
> dmigrations there would be no reason for dmigrations to exist at all.

Would be interesting to see how many times down() actually is used.
Feels like its only providing sense of safety because with the rapid
pace of todays web development you almost always go forward, and never
back.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google