[codex] Preserve required constraints when creating links#2371
[codex] Preserve required constraints when creating links#2371
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe changes modify the migration utility to reflect the required status of new attributes based on the link's forward.required property, and expose convertTxSteps for testing the required-plan step generation. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| 'index?': false, | ||
| ...uniqueAndCardinality, | ||
| 'required?': false, | ||
| 'required?': !!link.forward.required, |
There was a problem hiding this comment.
I think this was actually done on purpose -- because add-attr on a large set of data would throw an error in the transaction. It would take too long. Maybe we need to seperate this into two steps? add attr, and make-required?
There was a problem hiding this comment.
I think it's fine to do that later, since we have the same problem with adding indexed to a field.
But we might not actually validate required on this path. Can you double check that we actually validate that every entity has the field in this path?
|
View Vercel preview at instant-www-js-codex-fix-required-new-link-push-jsv.vercel.app. |
Summary
forward.requiredwhen diffing a newly created link so the first schema push emits the required steprequiredstepTesting
./node_modules/.bin/vitest run __tests__/src/migrations.test.ts