diefenbach / django-lfs

An online-shop based on Django
http://www.getlfs.com
BSD 3-Clause "New" or "Revised" License
622 stars 222 forks source link

Southization of LFS #34

Closed restless closed 11 years ago

restless commented 12 years ago

This pull request is intended to convert latest version of LFS to south. It doesn't affect older versions of LFS. The pull request contains:

  1. initial migrations for all LFS apps that have any models defined
  2. enhanced lfs_migrate script - after migrating to latest version the command: bin/django migrate --all --fake 0001 and then bin/django migrate is called.

The above means that:

  1. a new user who is going to install lfs will have to call bin/django migrate command
  2. an existing user who is going to migrate his shop from older to the latest version will have to call bin/django lfs_migrate command
  3. all further models changes should have migrations generated for them, and users migrating to newer versions will only have to call bin/django migrate
  4. 'south' should be added to INSTALLED_APPS in project's settings

Other: Pulling these changes will make LFS south compliant and will make it's further development easier.

diefenbach commented 11 years ago

Thanks for this!

Can you provide a step by step documentation how this has to be used for users comming from 0.5/0.6/0.7 and new users?

Kai

restless commented 11 years ago

So:

A. migrate from 0.7 (and from older versions) to latest dev version

  1. when you're on 0.7 then grab latest lfs with my changes (upgrade codebase)
  2. add south to INSTALLED_APPS in lfs_project/settings.py
  3. call bin/django lfs_migrate
  4. you're done

B. do a fresh install of latest dev version

  1. grab latest lfs with my changes
  2. make sure that south is added to INSTALLED_APPS
  3. call bin/django syncdb
  4. call bin/django migrate
  5. call lfs_init
  6. you're done

The above have just worked for me.

diefenbach commented 11 years ago

Regarding A:

When I do this and go to Management / Payment Methods I get an DatabaseError: "no such table: criteria_criterion"