Skip to content

Commit

Permalink
Bump sqlalchemy to 1.4 and database-related dependencies (#1009)
Browse files Browse the repository at this point in the history
  • Loading branch information
psrok1 authored Dec 18, 2024
1 parent 7732a16 commit 7931ae5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions mwdb/model/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@ class Object(db.Model):
share_3rd_party = db.Column(db.Boolean, nullable=False)

upload_count = column_property(
select([func.count(distinct(ObjectPermission.related_user_id))]).where(
select([func.count(distinct(ObjectPermission.related_user_id))])
.where(
and_(
ObjectPermission.object_id == id,
ObjectPermission.reason_type == AccessType.ADDED,
)
),
)
.scalar_subquery(),
deferred=True,
)

Expand Down Expand Up @@ -105,7 +107,7 @@ class Object(db.Model):
"User",
secondary="comment",
back_populates="commented_objects",
passive_deletes=True,
viewonly=True,
)

shares = db.relationship(
Expand Down
2 changes: 1 addition & 1 deletion mwdb/model/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class User(db.Model):
"Object",
secondary="comment",
back_populates="comment_authors",
passive_deletes=True,
viewonly=True,
)

comments = db.relationship(
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Werkzeug==3.0.6
gunicorn==22.0.0
alembic==1.4.2
alembic==1.14.0
Flask==2.3.3
Flask-SQLAlchemy==2.5.1
Flask-Migrate==3.1.0
SQLAlchemy==1.3.18
Flask-SQLAlchemy==3.0.5
Flask-Migrate==4.0.7
SQLAlchemy==1.4.54
marshmallow==3.20.2
psycopg2-binary==2.9.9
psycopg2-binary==2.9.10
requests==2.32.0
apispec[marshmallow,yaml]==6.4.0
bcrypt==3.1.4
Expand Down

0 comments on commit 7931ae5

Please sign in to comment.