Open FedeTorta opened 3 years ago
I'm stuck on the same error Would you please explain more about your workaround? How did you fake the migration exactly?
I executed the command:
python manage.py migrate --fake explorer 0004_querylog_duration
fixed with #474
It is not fixed I am dealing with the same error: `Running migrations: Applying hr.0002_auto_20210525_1447...This version of djongo does not support "schema validation using NOT NULL" fully. Visit https://nesdis.github.io/djongo/support/ This version of djongo does not support "COLUMN DROP DEFAULT " fully. Visit https://nesdis.github.io/djongo/support/ Not implemented alter command for SQL ALTER TABLE "hr_employee" ADD COLUMN "years_of_experience_in_domain" double DEFAULT %(0)s NOT NULL Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/djongo/cursor.py", line 51, in execute self.result = Query( File "/usr/local/lib/python3.9/site-packages/djongo/sql2mongo/query.py", line 783, in init self._query = self.parse() File "/usr/local/lib/python3.9/site-packages/djongo/sql2mongo/query.py", line 875, in parse raise e File "/usr/local/lib/python3.9/site-packages/djongo/sql2mongo/query.py", line 856, in parse return handler(self, statement) File "/usr/local/lib/python3.9/site-packages/djongo/sql2mongo/query.py", line 888, in _alter query = AlterQuery(self.db, self.connection_properties, sm, self._params) File "/usr/local/lib/python3.9/site-packages/djongo/sql2mongo/query.py", line 425, in init super().init(args) File "/usr/local/lib/python3.9/site-packages/djongo/sql2mongo/query.py", line 84, in init super().init(args) File "/usr/local/lib/python3.9/site-packages/djongo/sql2mongo/query.py", line 62, in init self.parse() File "/usr/local/lib/python3.9/site-packages/djongo/sql2mongo/query.py", line 435, in parse self._add(statement) File "/usr/local/lib/python3.9/site-packages/djongo/sql2mongo/query.py", line 598, in _add raise SQLDecodeError(err_key=tok.value, djongo.exceptions.SQLDecodeError:
Keyword: double
Sub SQL: ALTER TABLE "hr_employee" ADD COLUMN "years_of_experience_in_domain" double DEFAULT %(0)s NOT NULL
FAILED SQL: ('ALTER TABLE "hr_employee" ADD COLUMN "years_of_experience_in_domain" double DEFAULT %(0)s NOT NULL',)
Params: ([0.0],)
Version: 1.3.4
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 86, in _execute return self.cursor.execute(sql, params) File "/usr/local/lib/python3.9/site-packages/djongo/cursor.py", line 59, in execute raise db_exe from e djongo.database.DatabaseError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/app/manage.py", line 22, in
Relates to #543 . The root cause seems to be that djongo/sql2mongo/operators.py
fails to convert some sql queries to work with MongoDB.
I had the same issue. I guess djongo does not allow to alter a few things in the database. I simply deleted the collection on mongodb i wanted to alter and also deleted the specific migration file in on django. Then ran the same thing again and the collection was created as a new one.
I am using djongo 1.3.3 with Django 2.2.12 and with a docker container running MongoDB 4.4.1 on Windows 10. The project has the following INSTALLED_APPS section in settings.py:
I am facing a migration problem when cloning the project. Since the project has already a migration file, after cloning, I run the command:
Migrations seems to go well until migrations related to explorer app. Migrate command fails on explorer.0004_querylog_duration, due to the error
Traceback:
For now, the solution I found is to fake the migration on that specific migration file. Everything seem to work but I would like to understand what's wrong, because this solution is just a workaround.