Django creates wrong table

Hello! :wave: I am new to Django and decided to try a small implementation using MySQL, in a nutshell I want to create a table empleado (employee) with some basic data, but for some reason Django creates a differet table when running migrations, can someone point me to docs or explain me why is this happening?

So far:

  1. startapp empleado
  2. Edit models.py
  3. Create views.py
  4. Create url.py and import them
  5. Execute makemigrations and migrations
  6. Checked MySQL and saw this table:

Ah my bad, I forgot to add parenthesis to my model. Moving from codigo = models.IntegerField To codigo = models.IntegerField() solve the problem for makemigration and that was it, oops.

1 Like