chore(models): remove redundant server_default from oauth, source, onboarding and comment models - #42520
Open
CodeTrainerMan wants to merge 1 commit into
Conversation
…boarding and comment models
6 tasks
Contributor
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #42520 +/- ##
==========================================
- Coverage 87.53% 87.53% -0.01%
==========================================
Files 5468 5468
Lines 316733 316733
Branches 63517 63517
==========================================
- Hits 277265 277261 -4
- Misses 34098 34103 +5
+ Partials 5370 5369 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Sep 18, 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.
Summary
Part of #29314
Second slice of the redundant
server_defaultcleanup, following #42519 (trigger.py) and the same pattern as #39886. As described in the issue,server_defaultonly affects migration generation and is never applied while the application runs, so keeping both it and an equivalent application-leveldefault=on the same column is confusing - especially since new models are usually written by copying existing ones.server_defaultdefaultDatasourceProvider(oauth.py)is_defaultsa.false()FalseDatasourceProvider(oauth.py)expires_at"-1"-1DatasourceProvider(oauth.py)visibilitysa.text("'all_team_members'")PermissionEnum.ALL_TEAM(=="all_team_members")DataSourceOauthBinding(source.py)disabledsa.false()FalseDataSourceApiKeyAuthBinding(source.py)disabledsa.false()FalseAccountStepByStepTourState(onboarding.py)skippedsa.false()FalseWorkflowComment(comment.py)resolvedsa.false()FalseWorth calling out:
DatasourceProvider.expires_atis ansa.Integercolumn whoseserver_defaultwas the string"-1"rather than the integer-1, so it did not even match the application-leveldefault=-1it duplicated. Removing it leaves a single, type-correct source of truth.The remaining
server_default=func.current_timestamp()/func.now()entries oncreated_at/updated_atare untouched: they have no application-level default, so removing them would change insert behavior. That decision was already discussed in the issue.Scope: these four files only. Other model files are untouched to avoid overlapping with the in-flight PRs #39886 (
agent.py,credential_permission.py) and #41391 (skill.py).Verified locally:
ruff checkandruff format --diffon all four files are clean (ruff 0.16.6, the version pinned inapi/pyproject.toml), andpython -m py_compilepasses.make type-check(pyrefly) was not run locally because the optional vdb dependencies cannot be built in this Windows environment; CI covers it.Screenshots
Checklist
make lint; make type-check(backend) andvp staged(frontend) to appease the lint gods