collinskoech11 / FaMotorsRedo

0 stars 0 forks source link

MongoDb Migration err #1

Open collinskoech11 opened 2 years ago

collinskoech11 commented 2 years ago

TypeError: 'Collection' object is not callable. If you meant to call the 'update' method on a 'Collection' object it is failing because no such method exists.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/djongo/cursor.py", line 56, in execute params) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/djongo/sql2mongo/query.py", line 784, in init self._query = self.parse() File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/djongo/sql2mongo/query.py", line 885, in parse raise exe from e djongo.exceptions.SQLDecodeError:

    Keyword: None
    Sub SQL: None
    FAILED SQL: ALTER TABLE "django_content_type" DROP COLUMN "name" CASCADE
    Params: ()
    Version: 1.3.6

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/home/collins/Documents/sampleproj/env/lib/python3.6/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 "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/core/management/base.py", line 354, in run_from_argv self.execute(*args, cmd_options) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/core/management/base.py", line 398, in execute output = self.handle(*args, *options) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/core/management/base.py", line 89, in wrapped res = handle_func(args, kwargs) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 246, in handle fake_initial=fake_initial, File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/migrations/executor.py", line 117, in migrate state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/migrations/executor.py", line 227, in apply_migration state = migration.apply(state, schema_editor) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/migrations/migration.py", line 126, in apply operation.database_forwards(self.app_label, schema_editor, old_state, project_state) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/migrations/operations/fields.py", line 170, in database_forwards schema_editor.remove_field(from_model, from_model._meta.get_field(self.name)) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 559, in remove_field self.execute(sql) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 145, in execute cursor.execute(sql, params) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/backends/utils.py", line 98, in execute return super().execute(sql, params) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/backends/utils.py", line 66, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers return executor(sql, params, many, context) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/utils.py", line 90, in exit raise dj_exc_value.with_traceback(traceback) from exc_value File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/djongo/cursor.py", line 59, in execute raise db_exe from e django.db.utils.DatabaseError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "manage.py", line 22, in main() File "manage.py", line 18, in main execute_from_command_line(sys.argv) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/core/management/init.py", line 419, in execute_from_command_line utility.execute() File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/core/management/init.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/core/management/base.py", line 367, in run_from_argv connections.close_all() File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/utils.py", line 213, in close_all connection.close() File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/utils/asyncio.py", line 33, in inner return func(*args, **kwargs) File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/django/db/backends/base/base.py", line 294, in close self._close() File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/djongo/base.py", line 208, in _close if self.connection: File "/home/collins/Documents/sampleproj/env/lib/python3.6/site-packages/pymongo/database.py", line 829, in bool raise NotImplementedError("Database objects do not implement truth " NotImplementedError: Database objects do not implement truth value testing or bool(). Please compare with None instead: database is not None

collinskoech11 commented 2 years ago

todo

Switch to pymongo