Repository navigation
refactor(subscriptionsync): drop the legacy sync state table and the V2 naming - #5592
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…V2 naming Periodic subscription sync no longer reads or writes subscription_billing_sync_states, so drop its Ent schema, the Subscription.billing_sync_state edge and the table itself. With only one sync state left, rename the SubscriptionSyncStateV2 Ent entity to SubscriptionSyncState and drop the V2 suffix from the subscriptionsync types, adapter methods, tests and README. The table stays subscription_sync_states_v2: the schema pins the table, index and foreign key names so the migration only drops the legacy table.
db4b0d5 to
232389f
Compare
Summary
After #5589, periodic subscription sync schedules from
subscription_sync_states_v2and nothing reads or writessubscription_billing_sync_statesany more. This PR:SubscriptionBillingSyncStateEnt schema, theSubscription.billing_sync_stateedge and the table.V2suffix from the subscriptionsync Go identifiers (SyncStateV2->SyncState,SyncStateV2State*->SyncStateState*,GetSyncStatesV2,RecordSyncResultV2,MarkSubscriptionChangedV2, test spies and helpers,syncstatev2*.gofiles) and from comments, CLI help and the README.SubscriptionSyncStateV2toSubscriptionSyncState(packagedb/subscriptionsyncstate, edgesync_state) while keeping the database objects: the table stayssubscription_sync_states_v2, and the FK, check constraint and index names are pinned in the schema.No behaviour change. Stored state values are unchanged.
Migration
20261119133849_drop_subscription_billing_sync_states.up.sql:atlas migrate diffagainst the schema reports nothing else to change, so the entity rename does not touchsubscription_sync_states_v2.Verification
go build ./...POSTGRES_HOST=127.0.0.1 go test -tags=dynamic -count=1 ./openmeter/billing/worker/... ./openmeter/subscription/... ./test/subscription/... ./test/billing/... ./cmd/jobs/... ./app/common/... ./openmeter/ent/...POSTGRES_HOST=127.0.0.1 go test -tags=dynamic -count=1 -timeout 30m ./tools/migrate/...golangci-lint run ./...(0 issues)atlas migrate validate,atlas migrate diff(no changes),atlas migrate lint --latest 10(only the expected destructive-change notice for the drop)🤖 Generated with Claude Code
Summary by CodeRabbit


Confidence Score: 5/5
The PR appears safe to merge; no actionable defects were found.Summary
Removes the unused legacy sync-state table and drops
V2from subscription-sync Go names.Reviews (2) · Last reviewed commit: "refactor(subscriptionsync): drop the leg..." · Reviewed by Greptile