Skip to content

Commit 7931ae5

Browse files
authored
Bump sqlalchemy to 1.4 and database-related dependencies (#1009)
1 parent 7732a16 commit 7931ae5

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

mwdb/model/object.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ class Object(db.Model):
5858
share_3rd_party = db.Column(db.Boolean, nullable=False)
5959

6060
upload_count = column_property(
61-
select([func.count(distinct(ObjectPermission.related_user_id))]).where(
61+
select([func.count(distinct(ObjectPermission.related_user_id))])
62+
.where(
6263
and_(
6364
ObjectPermission.object_id == id,
6465
ObjectPermission.reason_type == AccessType.ADDED,
6566
)
66-
),
67+
)
68+
.scalar_subquery(),
6769
deferred=True,
6870
)
6971

@@ -105,7 +107,7 @@ class Object(db.Model):
105107
"User",
106108
secondary="comment",
107109
back_populates="commented_objects",
108-
passive_deletes=True,
110+
viewonly=True,
109111
)
110112

111113
shares = db.relationship(

mwdb/model/user.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class User(db.Model):
6868
"Object",
6969
secondary="comment",
7070
back_populates="comment_authors",
71-
passive_deletes=True,
71+
viewonly=True,
7272
)
7373

7474
comments = db.relationship(

requirements.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Werkzeug==3.0.6
22
gunicorn==22.0.0
3-
alembic==1.4.2
3+
alembic==1.14.0
44
Flask==2.3.3
5-
Flask-SQLAlchemy==2.5.1
6-
Flask-Migrate==3.1.0
7-
SQLAlchemy==1.3.18
5+
Flask-SQLAlchemy==3.0.5
6+
Flask-Migrate==4.0.7
7+
SQLAlchemy==1.4.54
88
marshmallow==3.20.2
9-
psycopg2-binary==2.9.9
9+
psycopg2-binary==2.9.10
1010
requests==2.32.0
1111
apispec[marshmallow,yaml]==6.4.0
1212
bcrypt==3.1.4

0 commit comments

Comments
 (0)