django-tenant-schemas icon indicating copy to clipboard operation
django-tenant-schemas copied to clipboard

Added get_sequences method

Open barkhabol opened this issue 1 year ago • 0 comments

This PR fixes issue raised from upgrading social-auth-app-django library to 5.4.0 version after Django 4.2 upgrade. Referenced from: https://github.com/bernardopires/django-tenant-schemas/pull/567

Applying social_django.0011_alter_id_fields

File "/Users/barkhamaheshwari/.virtualenvs/django4.2/lib/python3.11/site-packages/psqlextra/backend/schema.py", line 851, in alter_field
   super().alter_field(model, old_field, new_field, strict)
 File "/Users/barkhamaheshwari/.virtualenvs/django4.2/lib/python3.11/site-packages/django/db/backends/base/schema.py", line 831, in alter_field
   self._alter_field(
 File "/Users/barkhamaheshwari/.virtualenvs/django4.2/lib/python3.11/site-packages/django/db/backends/postgresql/schema.py", line 288, in _alter_field
   super()._alter_field(
 File "/Users/barkhamaheshwari/.virtualenvs/django4.2/lib/python3.11/site-packages/django/db/backends/base/schema.py", line 1011, in _alter_field
   fragment, other_actions = self._alter_column_type_sql(
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Users/barkhamaheshwari/.virtualenvs/django4.2/lib/python3.11/site-packages/django/db/backends/postgresql/schema.py", line 241, in _alter_column_type_sql
   if sequence_name := self._get_sequence_name(table, column):
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Users/barkhamaheshwari/.virtualenvs/django4.2/lib/python3.11/site-packages/django/db/backends/postgresql/schema.py", line 138, in _get_sequence_name
   for sequence in self.connection.introspection.get_sequences(cursor, table):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Users/barkhamaheshwari/.virtualenvs/django4.2/lib/python3.11/site-packages/django/db/backends/base/introspection.py", line 161, in get_sequences
   raise NotImplementedError(
NotImplementedError: subclasses of BaseDatabaseIntrospection may require a get_sequences() method

barkhabol avatar Nov 26 '24 16:11 barkhabol