chore: Replace 'db' with 'sa' for SQLAlchemy compatibility#35373
Merged
asukaminato0721 merged 4 commits intomainfrom Apr 19, 2026
Merged
chore: Replace 'db' with 'sa' for SQLAlchemy compatibility#35373asukaminato0721 merged 4 commits intomainfrom
asukaminato0721 merged 4 commits intomainfrom
Conversation
Contributor
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #35373 +/- ##
=======================================
Coverage 85.43% 85.43%
=======================================
Files 4431 4431
Lines 206713 206714 +1
Branches 38470 38470
=======================================
+ Hits 176612 176613 +1
Misses 26992 26992
Partials 3109 3109
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Updates workflow comment ORM models to use sqlalchemy as sa types/constructs instead of db.*, aligning these models with the broader SQLAlchemy-first patterns used across api/models.
Changes:
- Introduce
import sqlalchemy as sainapi/models/comment.py. - Replace
db.*column/constraint/type usages withsa.*equivalents (e.g.,PrimaryKeyConstraint,Text,DateTime,Boolean,text).
Comments suppressed due to low confidence (1)
api/models/comment.py:203
- These FK columns still use
db.ForeignKey(...)while this PR is replacingdb.*constructs withsqlalchemy as sa. Consider switching both tosa.ForeignKey(...)(orsqlalchemy.ForeignKey) for consistency and to avoid coupling schema definitions to the Flask-SQLAlchemydbinstance.
comment_id: Mapped[str] = mapped_column(
StringUUID, db.ForeignKey("workflow_comments.id", ondelete="CASCADE"), nullable=False
)
reply_id: Mapped[str | None] = mapped_column(
StringUUID, db.ForeignKey("workflow_comment_replies.id", ondelete="CASCADE"), nullable=True
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fatelei
approved these changes
Apr 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Fixes #<issue number>.Summary
Screenshots
Checklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint gods