How can my Model primary key start with a specific number?

the way is the same as to do datamigrations with RAW_SQL, change APPNAME on your:

python manage.py makemigrations APPNAME --empty

inside the created file:

operations = [
    migrations.RunSQL(
        'ALTER SEQUENCE APPNAME_USER_id_seq RESTART WITH 10000;'
    )
]

Leave a Comment