Shubham Kushwah
Shubham Kushwah

Reputation: 655

How to rename Table name in Django?

I just created a model named Carts and now I want to rename it to Cart only, how do I do it? I have tried doing this:

python manage.py makemigrations <app_name>

and then

python manage.py migrate

But its not reflecting the change in the database table: I am seeing the database as:

python manage.py sqlmigrate <app_name> 0001

Please Help!

Upvotes: 0

Views: 8561

Answers (1)

rajkris
rajkris

Reputation: 1793

Maybe change the model name in models.py file and run makemigrations and the migrate.

Upvotes: 2

Related Questions