Hello
I need to use an existing SQL database with Django. The database was under MSAccess. I generated a Dump of the database. I use SQL" source" command to generate my SQL database. Then I do Python manage.py inspectDB. I incorporate the proposed Django model in models.py. Then I do manage.py makemigrations.  Then I do python manage.py migrate. And I get the following error message.

File "/home/christian/djangorecettes/monvenv/lib/python3.6/site-packages/MySQLdb/connections.py", line 276, in query
    _mysql.connection.query(self, query)
django.db.utils.OperationalError: (1050, "Table 'Categorie_de_recettes' already exists")

After searching on the web it appears that it is an SQL error and several people mentionned going around it by changing from InnoDB to MyIsam engin.

So I started the wohole process again modifying the dump with ENGINE= MYISAM.
Python manage.py inspectDNB
copy the model into models.py
Python manage.py makemigrations.
I get the following error message :
auth.Group.permissions: (fields.E340) The field's intermediary table 'auth_group_permissions' clashes with the table name of 'mesrecettes.AuthGroupPermissions'

I checked the model the following way: I used the generated models.py to generate an empty database. NO problem and the use of the admin form allows me to create elements in the database.

Any suggestion would be much welcomed as I am getting desperate.>:o

My next step could be to fill the empty database with SQL commands in batch but I would like to avoid it.
Piscvau



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/587dfa02-d6f5-d6c2-bc99-2fd4e6ff396b%40yahoo.fr.
For more options, visit https://groups.google.com/d/optout.

Reply via email to