Skip to content

Commit

Permalink
Add support for SQLAlchemy 1.4. (#1328)
Browse files Browse the repository at this point in the history
  • Loading branch information
thedrow authored Apr 6, 2021
1 parent 4446438 commit 7c34684
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kombu/transport/sqlalchemy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@

from sqlalchemy import (Column, Integer, String, Text, DateTime,
Sequence, Boolean, ForeignKey, SmallInteger, Index)
from sqlalchemy.ext.declarative import declarative_base, declared_attr
from sqlalchemy.orm import relation
from sqlalchemy.schema import MetaData

try:
from sqlalchemy.orm import declarative_base, declared_attr
except ImportError:
# TODO: Remove this once we drop support for SQLAlchemy < 1.4.
from sqlalchemy.ext.declarative import declarative_base, declared_attr

class_registry = {}
metadata = MetaData()
ModelBase = declarative_base(metadata=metadata, class_registry=class_registry)
Expand Down

0 comments on commit 7c34684

Please sign in to comment.