jedie / django-tools

miscellaneous django tools
http://pypi.python.org/pypi/django-tools/
Other
128 stars 31 forks source link

add south support for dynamic_site application. #4

Closed szelga closed 11 years ago

jedie commented 11 years ago

Thx for contribution.

But why should we add a initial migration, without any schema change?

Btw. i'm work on django1.5 support, see: https://github.com/jedie/django-tools/compare/django1.5

szelga commented 11 years ago

we should add an initial schemamigration because there was no south support before.

manage.py migrate dynamic_site

command will create necessary db schema then.

jedie commented 11 years ago

Sorry, i didn't understand. Why need we south "support"? You can use south for other django apps, even if there is no initial migration in django-tools.

A initial schema migration is only needed if we change the db schema in dynamic_site.

szelga commented 11 years ago

initial migration is necessary: it's a foundation for subsequent database changes.

jedie commented 11 years ago

Yes, but only for the app which change his model. The dynamic site model has no schema migration. Do you plan to change the dynamic site models?

It's not needed that every INSTALLED_APPS has initial migration.

Did I miss something?

szelga commented 11 years ago

if you will change models in the future, you will need initial migration.

jedie commented 11 years ago

Yes. But we only need it then. I didn't see the need for to doing this now.

One reason to do it if it's needed: Maybe south would also be change in the future and the inital migration must be updated, too.

szelga commented 11 years ago

maybe you don't use south very often? here's the workflow with django and south:

  1. you create a model, then initial migration for that model and release your application.
  2. user installs your application into their project, then migrates to initial migration, thus creating database table and some schema (instead of syncdb).
  3. you update the model, create a schema migration which contains differences you've made to the model.
  4. user updates your application, then types a command
python manage.py migrate

and south automatically updates db schema.

for further information you can read this document: http://south.readthedocs.org/en/latest/tutorial/part1.html

jedie commented 11 years ago

It's enough to create a initial migration before we change the model. It's not needed to create it now.

Do you know the --fake argument? See: http://south.readthedocs.org/en/latest/convertinganapp.html