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?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.