migration in Satchmo with south

5 views
Skip to first unread message

Tay Ray Chuan

unread,
Mar 16, 2010, 11:02:53 PM3/16/10
to Satchmo developers, Chris Moffitt
Hi,

in response to ticket #319 (Implement one of the django migration
scripts), I wrote the wiki page 'Migrations'; you can see it here:

http://bitbucket.org/chris1610/satchmo/wiki/Migrations

I also tried using south for the product app, since we've touched the
models recently in the fix for #769 (Discount.validProducts causing
case-significance issues in database tables) and users will have to
touch their database tables; check it out here:

http://github.com/rctay/satchmo/compare/tip...rc/south-769

To see how users will handle validProducts change using south, please
see the "Workflow for Satchmo user" in
http://bitbucket.org/chris1610/satchmo/wiki/Migrations#south.

I think south is the way to go. It's really easy to use, for Satchmo
developers and users alike.

Right now, users will have to specify which satchmo app to migrate. To
make things easier for the user, we could provide a custom command to
manage.py, say, migrate_satchmo, so that users don't have to remember
which satchmo apps have migrations.

--
Cheers,
Ray Chuan

Chris Moffitt

unread,
Mar 16, 2010, 11:12:25 PM3/16/10
to Satchmo developers
I agree, South is the way to go. I was mentally thinking that we start with 0.9 as the initial and build migrations from there. The process you describe is pretty similar to what I was thinking.

When I tried to migrate the product attribute change ( http://bitbucket.org/chris1610/satchmo/wiki/BackwardsIncompatibleChangesAfter0.9 ), I did get some errors about default data but didn't try to figure out the result. Assuming we can bridge the gap, I think this is the way to go. The nice thing is that if someone doesn't install South, the migrations are just ignored so there's no impact there.

-Chris

On Tue, Mar 16, 2010 at 10:02 PM, Tay Ray Chuan <rct...@gmail.com> wrote:
Hi,

in response to ticket #319 (Implement one of the django migration
scripts), I wrote the wiki page 'Migrations'; you can see it here:

 http://bitbucket.org/chris1610/satchmo/wiki/Migrations

I also tried using south for the product app, since we've touched the
models recently in the fix for #769 (Discount.validProducts causing
case-significance issues in database tables) and users will have to
touch their database tables; check it out here:

Tay Ray Chuan

unread,
Mar 16, 2010, 11:23:10 PM3/16/10
to satchmo-d...@googlegroups.com
On Wed, Mar 17, 2010 at 11:12 AM, Chris Moffitt <ch...@moffitts.net> wrote:
> When I tried to migrate the product attribute change (
> http://bitbucket.org/chris1610/satchmo/wiki/BackwardsIncompatibleChangesAfter0.9
> ), I did get some errors about default data but didn't try to figure out the
> result. Assuming we can bridge the gap, I think this is the way to go. The
> nice thing is that if someone doesn't install South, the migrations are just
> ignored so there's no impact there.

I will try integrating south migrations starting with the product app,
with it's base at v0.9, then gradually working through the various
backwards-incompatible changes involving product models.

--
Cheers,
Ray Chuan

Tay Ray Chuan

unread,
Mar 17, 2010, 12:28:00 AM3/17/10
to satchmo-d...@googlegroups.com
Hi,

this is even easier than I thought!

The backwards-incompatible changes addressed by south migrations are:

* product attributes improvement
* unique together constraint on CustomTextField feature
* Discount.validProducts field rename

You can see it here:

http://github.com/rctay/satchmo/compare/tip...rc/south-product

I'll be importing this into mercurial and opening a ticket soon.

--
Cheers,
Ray Chuan

Johannes Bornhold

unread,
Mar 17, 2010, 4:37:43 PM3/17/10
to satchmo-d...@googlegroups.com
Hi,

Am Mittwoch, den 17.03.2010, 11:02 +0800 schrieb Tay Ray Chuan:
> I think south is the way to go.

We also made good experiences with south. It would be great to see this
used for migrations in satchmo.

Cheers,

Johannes

Tay Ray Chuan

unread,
Mar 18, 2010, 10:24:39 PM3/18/10
to satchmo-d...@googlegroups.com
Hi,

On Wed, Mar 17, 2010 at 12:28 PM, Tay Ray Chuan <rct...@gmail.com> wrote:
> The backwards-incompatible changes addressed by south migrations are:
>
>  * product attributes improvement
>  * unique together constraint on CustomTextField feature
>  * Discount.validProducts field rename
>
> You can see it here:
>
>  http://github.com/rctay/satchmo/compare/tip...rc/south-product
>
> I'll be importing this into mercurial and opening a ticket soon.

update: South migrations for backwards-incompatible changes to product
have been merged into Satchmo:

http://bitbucket.org/chris1610/satchmo/issue/1073/pull-request-add-south-migrations-since-v09-for-product

I hope to add migrations for the other incompatible changes to the
other apps in time for the next release.

--
Cheers,
Ray Chuan

Reply all
Reply to author
Forward
0 new messages