42
loading...
This website collects cookies to deliver better user experience
django.db.models.Model
class.from django.db import models
class Student(models.Model):
name = models.CharField(max_length=100)
roll = models.IntegerField()
address = models.CharField(max_length=200)
CREATE TABLE Student
(
roll int,
name varchar(100),
address varchar(200)
);
python manage.py makemigrations
. See the example bro.
migrations
.
0001_initial.py
which contains the information about our reflected changes in the database, which looks like this.
python manage.py migrate
. This command will run the latest migrations made and reflect their changes.