Skip to content

Fix migrations for latest versions of CockroachDB#25280

Closed
Nitwel wants to merge 5 commits intomainfrom
nitwel/eng-1289
Closed

Fix migrations for latest versions of CockroachDB#25280
Nitwel wants to merge 5 commits intomainfrom
nitwel/eng-1289

Conversation

@Nitwel
Copy link
Member

@Nitwel Nitwel commented Jun 5, 2025

Scope

What's changed:

  • Use cockroach native approach for changing primary key

Potential Risks / Drawbacks

  • Possibly performance, but shouldn't matter in migrations

Review Notes / Questions

I tested this with CRDB v23.2 and everything was working fine there.


Fixes #25262
Closes ENG-1289

@Nitwel Nitwel requested a review from a team as a code owner June 5, 2025 13:18
@linear
Copy link

linear bot commented Jun 5, 2025

@changeset-bot
Copy link

changeset-bot bot commented Jun 5, 2025

🦋 Changeset detected

Latest commit: f53cd99

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@directus/api Patch
directus Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@br41nslug
Copy link
Member

Is this native primary key approach backwards compatible with the existing v23 an v24 LTS versions?

@Nitwel
Copy link
Member Author

Nitwel commented Jun 5, 2025

We'll figure that out by seeing if Backbox tests pass but I'd guess so, let me check...

@Nitwel
Copy link
Member Author

Nitwel commented Jun 5, 2025

From what I can see, it's likely been introduced in v20 as it doesn't exist in the docs previous to that: https://www.cockroachlabs.com/docs/v20.1/alter-primary-key.html

@ComfortablyCoding
Copy link
Member

We'll figure that out by seeing if Backbox tests pass but I'd guess so, let me check...

The blackbox tests do not run for CRDB https://github.com/directus/directus/blob/main/.github/workflows/blackbox.yml#L56

@Nitwel Nitwel requested a review from a team June 5, 2025 16:56
@Nitwel
Copy link
Member Author

Nitwel commented Jun 5, 2025

Should include it now but I guess I better check manually as well if it worked with older versions.

@codecov
Copy link

codecov bot commented Aug 5, 2025

Codecov Report

❌ Patch coverage is 22.22222% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.26%. Comparing base (6c3e76f) to head (f53cd99).
⚠️ Report is 192 commits behind head on main.

❌ Your patch status has failed because the patch coverage (22.22%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #25280      +/-   ##
==========================================
- Coverage   56.26%   56.26%   -0.01%     
==========================================
  Files        2001     2001              
  Lines      125055   125069      +14     
  Branches     6308     6308              
==========================================
+ Hits        70367    70371       +4     
- Misses      54688    54698      +10     
Flag Coverage Δ
api 35.42% <22.22%> (-0.01%) ⬇️
app 69.81% <ø> (ø)
composables 82.80% <ø> (ø)
create-directus-extension 94.44% <ø> (ø)
create-directus-project 98.43% <ø> (ø)
env 99.66% <ø> (ø)
errors 97.31% <ø> (ø)
extensions 35.63% <ø> (ø)
extensions-registry 95.27% <ø> (ø)
extensions-sdk 14.41% <ø> (ø)
format-title 100.00% <ø> (ø)
memory 95.75% <ø> (ø)
pressure 77.63% <ø> (ø)
release-notes-generator 81.14% <ø> (ø)
schema-builder 80.56% <ø> (ø)
sdk 5.93% <ø> (ø)
storage 92.00% <ø> (ø)
storage-driver-azure 76.76% <ø> (ø)
storage-driver-cloudinary 81.14% <ø> (ø)
storage-driver-gcs 69.72% <ø> (ø)
storage-driver-local 69.76% <ø> (ø)
storage-driver-s3 46.73% <ø> (ø)
storage-driver-supabase 67.75% <ø> (ø)
update-check 55.67% <ø> (ø)
utils 87.16% <ø> (ø)
validation 44.50% <ø> (ø)

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AlexGaillard
Copy link
Member

This is deeply stale. Going to close this one out and keep the branch if we ever want to revisit it.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CockroachDB migrations stuck in infinite loop without SKIP_MIGRATIONS=true

4 participants