10000 django-spanner's autofield generation does not work for non-default spanner DBs · Issue #783 · googleapis/python-spanner-django · GitHub
[go: up one dir, main page]

Skip to content
django-spanner's autofield generation does not work for non-default spanner DBs #783
Closed
@untitaker

Description

@untitaker

#780 introduced a check as to whether the default database's engine is spanner or not, and depending on that decides to override id generation with clientside uuid or not.

This fix is insufficient. It does improve the situation, as django-spanner will disable its monkeypatches if the default db is not spanner.

But the original issue #742 was talking about using multiple databases, where default db is mysql. This is what django.db.connection.settings_dict refers to. The correct key to check would be django.db.connections[???].settings_dict.

Steps to reproduce

  1. set up spanner as a non-default database
  2. see that even running basic migrations against that non-default db fails, as the inserts into the django_migrations table already fail.

I'll investigate how to fix. It's likely something else has to be patched entirely.

Environment details

  • Programming language: Python
  • OS: Doesn't matter
  • Language runtime version: 3.8
  • Package version: master

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: spannerIssues related to the googleapis/python-spanner-django API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0