mirror of
https://github.com/hanzoai/commerce.git
synced 2026-10-30 15:08:42 +00:00
Multi-tenant commerce and billing: orders, subscriptions, invoices, plans, usage metering and a credit ledger. One Go binary. MIT OR Apache-2.0. Claude-Session: https://claude.ai/code/session_01SAtaDFm8VDiWrhYHNNtxMw
29 lines
862 B
Go
29 lines
862 B
Go
package migrations
|
|
|
|
import (
|
|
"github.com/hanzoai/base/core"
|
|
)
|
|
|
|
// 1754600000 — the IAM org is the org; commerce keeps no registry of its own.
|
|
// These collections were that registry (hostname rows the public resolver
|
|
// stopped reading once host→brand→IAM-org became the one path); dropping them
|
|
// ends the split authority. Idempotent: a datadir that never had them passes
|
|
// through untouched, and there is no way back — the registry's schema lives
|
|
// only in git history.
|
|
func init() {
|
|
core.AppMigrations.Register(func(app core.App) error {
|
|
for _, name := range []string{"commerce_tenant_hostnames", "commerce_tenants"} {
|
|
c, err := app.FindCollectionByNameOrId(name)
|
|
if err != nil || c == nil {
|
|
continue
|
|
}
|
|
if err := app.Delete(c); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}, func(app core.App) error {
|
|
return nil
|
|
})
|
|
}
|