FAQ Database Discussion Community


Do django db_index migrations run concurrently?

django,django-south,django-migrations
I'm looking to add a multi-column index to a postgres database. I have a non blocking SQL command to do this which looks like this: CREATE INDEX CONCURRENTLY shop_product_fields_index ON shop_product (id, ...); When I add db_index to my model and run the migration, will it also run concurrently or...

Revert Django 1.7 RemoveField migration

django,django-south,django-1.7,django-migrations
If I have a non-nullable model field, remove it, and create a migration, that migration becomes non-reversible: Consider the following model: class Foo(models.Model): bar = models.TextField() test = models.TextField() # This field is to go away, bye-bye! And migration: # app/migrations/003_remove_foo_test.py class Migration(migrations.Migration): dependencies = [ ('app', '0002_foo_test'), ] operations...

How do I reset a django app and start clean both with south migrations and in the database?

django,postgresql,django-south
I need a way to just hit "reset" on an app both for south migrations and in the database. What is a good way to do this?...

django cms: plugin models out of sync with its database tables

python,django,django-south,django-cms
After upgrading django cms from version 2.4.3 to 3.0.11 (currently it's 3.0.12) I have realised that some models are "out of sync" with its database tables. For example: class ProjectPagePluginModel(cmsPlugin): """ CMS project plugin model. """ project = models.ForeignKey(Project, on_delete=CASCADE) max_occurrences = models.PositiveIntegerField(default=0) def __unicode__(self): return self.get_plugin_name() >>> ProjectPagePluginModel.objects.all() Traceback...

Django migrations missing way to declare “needed_by”?

django,dependencies,database-migration,django-south
If you have two apps: core_app plugin_app The core does not need the optional plugin. Up to now we used south and could use needed_by if a migration of the plugin needs to run before a migration of the core app. I could not find something in the docs: https://docs.djangoproject.com/en/1.8/topics/migrations/...

South error, but not using it. “no South database module 'south.db.mysql'”

django,django-south
After installing of Django I get this error message (when I want to run migrations or runserver): There is no South database module 'south.db.mysql' for your database. Please either choose a supported database, check for SOUTH_DATABASE_ADAPTER[S] settings, or remove South from INSTALLED_APPS. I dont want to use South and it...

django - trouble with migrations and modeltranslations [SOLVED]

python,django,django-south,django-modeltranslation
I am trying to upgrade my app, from Django v1.6.11 to v1.7.8. I am following the instructions to upgrade from South but get again and again the same error. More precisely: $ python manage.py migrate makemigrations /home/roberto/virtualenvs/ve_unicms-django1.7/local/lib/python2.7/site-packages/reversion/admin.py:385: RemovedInDjango18Warning: commit_on_success is deprecated in favor of atomic. def recover_view(self, request, version_id, extra_context=None):...

django south migration error relation “photo_photo” already exists

python,django,django-south
I am using Django South.I am following the tutorial of http://south.readthedocs.org/en/latest/tutorial/part1.html first of all i want to give some information about my project and the apps. I have a django app namely photo and i have two model namely Photo and UserCommission. these are the models class Photo(models.Model): name =...

Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually

django,migration,django-south,django-1.8
I am trying to migrate from Django 1.6 to Django 1.8. I was using South for managing migrations in Django 1.6. I have successfully created new migration files by python manage.py makemigrations. while running python manage.py migrate --fake-initial, I am getting this error Traceback (most recent call last): File "manage.py",...

ProgrammingError: relation “django_redirect” does not exist when running django tests

python,django,unit-testing,django-south
I am trying to run a very simple test using django: class PaymentTests(TestCase): def setUp(self): self.c = Client() def test_can_see_chat_for_an_anynomous_user(self): response = self.c.get('/') self.assertEqual(200, response.status_code) Unfortunately each time I try to run it I get an error: (project)[email protected] /mnt/hgfs/Dev/LegalStart/project $ python manage.py test --rednose useracts.tests:PaymentTests nosetests useracts.tests:PaymentTests --rednose --verbosity=1 Creating...

Trouble while adding south to existing app

python,django,migration,django-south
I am following the djano-rest-framework tutorial. I am trying to add south for db migration. This is what my pip freeze looks like: Django==1.8.1 djangorestframework==3.1.2 MySQL-python==1.2.5 Pygments==2.0.2 South==1.0.2 My settings.py for the tutorial project looks like this: INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'snippets', 'south' )...

Database integrity errors when deploying Python(2.7)/Django(1.5) app on Heroku

python,django,heroku,django-south,heroku-postgres
These days I'm learning Python(2.7)/Django(1.5) via developing a reddit clone. The clone is almost done and works perfectly in my local environment (db = sqlite3). But when I try to host the same thing on Heroku (db = postgres), things go awry. Specifically, the web app still loads, but the...

Upgrading from Django 1.6 (with south) to 1.8 doesn't modify 'last_login' on the user table

python,mysql,django,django-south,django-1.8
I have upgraded from Django 1.6.5 (with south migrations) to Django 1.8. I have followed the instructions here: https://docs.djangoproject.com/en/1.8/topics/migrations/#upgrading-from-south So I remove South, delete my previous migrations and run python manage.py makemigrations which makes a new migration file. Then I run python manage.py migrate --fake-initial to fake the initial migration....