Search code examples
pythondjangodjango-south

How to create a migration to insert initial data into a table?


So this is my model:

class Config(models.Model):
    config_key = models.CharField(max_length=50)
    config_value = models.CharField(max_length=255)

I have created an initial migration with:

python manage.py schemamigration myapp --initial

But now I would like to insert some initial data inside the config table and create a migration that inserts that data (basically it will run on insert sql query).

How to do it?


Solution

  • python manage.py datamigration myapp name_migration