Manage migrations
  • 05 Mar 2024
  • 1 Minute to read
  • Dark
    Light
  • PDF

Manage migrations

  • Dark
    Light
  • PDF

Article summary

The following procedure explains how to create a new data model in your module.

  1. Edit the models.py file.

    # example/models.py
    from django.db import models
    
    class QRCode(models.Model):
        text = models.CharField(max_length=100)
  2. Install your module.

    cb add django-example
  3. Generate the migrations.

    cd backend
    pipenv shell
    python manage.py makemigrations
  4. Save the newly generated migration files in your module.

    cb commit django-example

You now have the migration files for your module that live inside your module's Django app.


Was this article helpful?