feat(api): OSS-to-EE adoption migration on the EE chain#4683
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
4f35d7b to
6c47e27
Compare
e1764f5 to
c0c4f01
Compare
631d499 to
a500bff
Compare
Railway Preview Environment
|
a500bff to
9c11f6c
Compare
407a0cf to
553a01a
Compare
8653507 to
01c058e
Compare
01c058e to
3cd35cc
Compare
8829687 to
d8682ac
Compare
3cd35cc to
e717dae
Compare
d8682ac to
0145eed
Compare
7b7346f to
3d96326
Compare
9b2e417 to
1e0e499
Compare
3d96326 to
3858d3f
Compare
1e0e499 to
5bd61fd
Compare
3858d3f to
52d8077
Compare
5bd61fd to
5c39511
Compare
52d8077 to
19e4325
Compare
5c39511 to
e65c76a
Compare
19e4325 to
920dfd9
Compare
e65c76a to
296ccc4
Compare
920dfd9 to
c2f7973
Compare
296ccc4 to
3b889cb
Compare
c2f7973 to
588af2d
Compare
Conditional revision serving every flow: complete no-op on EE-origin databases; on adopted OSS databases it creates the EE-only enum and tables in their canonical post-cleanup shapes and backfills one subscription per org on the configured free plan (anchor = adoption day) plus the USERS gauge from organization_members. References only EE tables and forever-stable shared PKs, per the chain rules. Revision ee0000000002, down_revision ee0000000001 (the EE chain proof).
…ringing it back up
…tion The hand-written CREATE TABLE declared organization_domains.meta and organization_providers.meta as json, while the native EE migration (59b85eb7516c) and the sibling flags/tags columns use jsonb. Align them so a switched OSS database matches the native EE schema.
3b889cb to
cabcd20
Compare
c48ebcb to
e46a082
Compare
Context
The chain split (#4680) makes an in-place OSS→EE switch structurally possible: point the EE stack at the OSS databases and run the EE runner. This PR adds the revision that makes it actually work — the EE chain's adoption migration. Design:
docs/designs/oss-ee-convergence/migration-chains-and-edition-switch.md.Changes
One conditional revision (
e00000000003) on the EE-only chain:meters_typeand the four EE-only tables (subscriptions,meters,organization_domains,organization_providers) in their canonical post-cleanup shapes (six nullable lifecycle columns, billing FKs anchored toorganizations(id) ON DELETE CASCADE), then backfills one subscription per organization on the configured free plan (get_free_plan(), anchor = adoption day) and the USERS gauge recomputed fromorganization_members. Domains and providers start empty.References only EE tables and forever-stable shared PKs, per the chain rules.
What to QA
Replay an OSS database to head, switch the stack to EE (same postgres,
POSTGRES_URI_*pointing at theagenta_oss_*databases), run the EE runner: the schema dump afterwards should be identical to a fresh EE database's dump except data-bearing rows; running the runner twice must be a no-op.🤖 Generated with Claude Code