Skip to content

feat(migrations): support specifying schema for migrations#471

Open
cofin wants to merge 10 commits into
mainfrom
feat/migration-default-schema
Open

feat(migrations): support specifying schema for migrations#471
cofin wants to merge 10 commits into
mainfrom
feat/migration-default-schema

Conversation

@cofin
Copy link
Copy Markdown
Member

@cofin cofin commented May 25, 2026

Summary

  • Add migration default_schema and tracker schema resolution through migration config, commands, runners, and utilities.
  • Keep BigQuery on the shared SyncMigrationTracker; remove the custom adapter tracker path.
  • Patch BigQuery SQLGlot DDL rendering so shared tracker SQL emits PRIMARY KEY NOT ENFORCED and orders DEFAULT before NOT NULL.
  • Simplify Oracle migration schema handling to uppercase unquoted schema names and use shared identifier quoting.
  • Gate BigQuery full migration workflow integration tests behind native BigQuery because the emulator rejects column DEFAULT values in tracker DDL.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 25, 2026

Codecov Report

❌ Patch coverage is 97.05015% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.06%. Comparing base (6f91042) to head (be49264).

Files with missing lines Patch % Lines
sqlspec/migrations/runner.py 90.47% 1 Missing and 5 partials ⚠️
sqlspec/adapters/adbc/driver.py 89.65% 2 Missing and 1 partial ⚠️
sqlspec/adapters/oracledb/migrations.py 95.45% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #471      +/-   ##
==========================================
+ Coverage   70.78%   71.06%   +0.28%     
==========================================
  Files         438      438              
  Lines       52541    52841     +300     
  Branches     7370     7407      +37     
==========================================
+ Hits        37189    37553     +364     
+ Misses      12682    12652      -30     
+ Partials     2670     2636      -34     
Flag Coverage Δ
integration 56.76% <78.46%> (+0.17%) ⬆️
py3.10 68.13% <94.69%> (+0.27%) ⬆️
py3.11 68.15% <94.69%> (+0.27%) ⬆️
py3.12 68.14% <94.69%> (+0.27%) ⬆️
py3.13 68.14% <94.69%> (+0.27%) ⬆️
py3.14 70.22% <94.61%> (+0.26%) ⬆️
unit 57.87% <87.31%> (+0.42%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cofin cofin force-pushed the feat/migration-default-schema branch from ec9e0c8 to b9d3ad2 Compare May 25, 2026 23:39
@cofin cofin changed the title feat: add migration default schema support feat(migrations): support specifying schema for migrations May 25, 2026
@cofin cofin marked this pull request as ready for review May 26, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants