Modify

Ticket #934 (closed defect: duplicate)

Opened 3 years ago

Last modified 3 years ago

south does not update model permissions

Reported by: alan.kesselmann@… Owned by: andrew
Priority: major Milestone:
Component: migrations Version: 0.7.3
Keywords: Cc:

Description

Hello

i have encountered a problem when south updates database only when model itself has changed - but when you only change its (models) permissions, then those do not get updated.

My setup:
INSTALLED_APPS = (

'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'cms', #django-cms apps start
'cms.plugins.text',
'cms.plugins.picture',
'cms.plugins.link',
'cms.plugins.file',
'cms.plugins.snippet',
'cms.plugins.googlemap',
'menus',
'mptt',
'publisher', #django-cms apps end
'south', #database schema migrations
'guardian', #object based permissions
'rosetta', #.po files translations

and so on...

setup includes 'guardian' which is https://github.com/lukaszb/django-guardian - this i use for object based permissions, but since my permissions are set up exactly like django wants them to be (https://docs.djangoproject.com/en/dev/ref/models/options/#permissions), then i dont think the case is related to 'guardian' app. Moreover - after talking to guardians creator he says that he has not encountered that problem when using django's own syncdb.

How to reproduce the problem:

  1. Create model. Add few fields and few permissions.
  2. run python manage.py schemamigration yourapp --initial
  3. run python manage.py migrate yourapp
  4. tables were created, columns were added and rows were added to auth_permission table
  5. add few more fields/columns to your previously created model
  6. add few more permissions
  7. run python manage.py schemamigration yourapp --auto & python manage.py migrate yourapp
  8. again - new fields were created and new auth_permission table rows were created - so far so good
  9. this time add just new permissions - make no other changes to your model.
  10. run python manage.py schemamigration yourapp --auto and you get :
  11. Nothing seems to have changed.
  12. run python manage.py migrate yourapp 13.
  13. Running migrations for yourapp:
  14. - Nothing to migrate.
  15. - Loading initial data for yourapp.
  16. No fixtures found.
  17. no new rows were created in auth_permissions table
  18. python manage.py syncdb does not do anything either

Alan

Attachments

Change History

comment:1 Changed 3 years ago by andrew

  • Status changed from new to closed
  • Resolution set to duplicate

Duplicate of #211.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.