Questions tagged [django-migrations]

Django migrations are a way to apply changes to a database previously created, introduced in Django 1.7. This tool is used when a model is modified (adding a field, deleting a model, etc.) and you need to apply these changes to your database.

Migrations are introduced in Django 1.7 to make easier modifications in models:

Migrations are Django’s way of propagating changes you make to your models (adding a field, deleting a model, etc.) into your database schema. They’re designed to be mostly automatic, but you’ll need to know when to make migrations, when to run them, and the common problems you might run into.

There are several commands which you will use to interact with migrations and Django’s handling of database schema:

  • migrate, which is responsible for (un)applying migrations
  • makemigrations, to create new migrations files based on model modifications
  • sqlmigrate, which displays the SQL statements for a migration.
  • showmigrations, which lists a project’s migrations and their status.

This tag is not about migrating to Django from another framework. This is supposed to replace , which is a third-party mainly used until Django 1.6 to migrate models modifications.

1460 questions
-1
votes
1 answer

heroku - DatabaseError: relation "south_migrationhistory" does not exist

i purchased an outsource service to develop a web site in django to be deployed in heroku and AWS S3 (boto package). Unfortunately the developer did not comment the code, despite it was asked, and left the project uncompleted for following up with a…
user305883
  • 1,635
  • 2
  • 24
  • 48
-1
votes
1 answer

From Django1.7 onwards `migration` is into the core. Is it similar to `south`?

I am using south for migrations. Today I surprisingly found an interesting article, django1.7 support migrations. Interestingly I found that the startapp command even creates a folder migrations. python manage.py startapp myapp has tree: myapp/ …
suhailvs
  • 20,182
  • 14
  • 100
  • 98
-2
votes
2 answers

Triyng to slugify url from title posts in a Django blog

Made the slug variable for futures urls and did ./makemigrations and migrate and the parameter appears in the admin panel, but when I try to migrate after I made an empty "theblog" migration I get this error: class Migration(migrations.Migration): …
Gerard
  • 47
  • 8
-2
votes
1 answer

I cant migrate and run my server successfully in django

I am getting an error whenever i want to migrate and run my server in Django. File "C:\Program Files\Python37\lib\site-packages\django\db\backends\base\base.py", line 195, in connect self.connection =…
-4
votes
0 answers

when we are trying to migrate from python 3.9 to 3.11, getting an error - No module named 'asyncio.base_events'

I was trying to migrate the project from python 3.9 to python 3.11 but getting an error like 'no module name asyncio.base_events'. I also tried using hidden imports but getting an error like no module. Both errors are captured below File…
1 2 3
97
98