Reputation: 3762
Django follows the standard applicationName_ModelName for its tables. How can I change it so that it creates a table name that I want ?
Upvotes: 2
Views: 1973
Reputation: 2141
You need to set the db_table
meta option. See the documentation. For example:
class MyModel(models.Model):
class Meta:
db_table = "mytable_name"
Upvotes: 3