# Prepare migration using the latest model definitions
python manage.py makemigrations [app_name]
# Apply migrations for specified app using specified database connection (in settings.py)
python manage.py migrate [app_name] --database [database_name]
#record latest model before migration
python3 manage.py makemigrations [app_name]
#migrate to database
python3 manage.py migrate
# configure your database first before migrating default database will be sqlite3
python manage.py makemigrations
python manage.py migrate --fake
python manage.py migrate your_app zero
$ manage.py migrate --fake <appname> zero
$ rm -rf migrations
$ manage.py makemigrations <appname>
$ manage.py migrate --fake
# Generated by Django 2.2.5 on 2019-09-25 06:00
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name ='GeeksModel',
fields =[
('id', models.AutoField(auto_created = True,
primary_key = True, serialize = False,
verbose_name ='ID')),], ),
]