A new tenant database is created by copying a ready-made template rather than replaying every schema change ever written.
Provision a Tenant by Cloning a Pre-Migrated Template
Provisioning ran the full set of roughly 1,270 schema migrations against an empty database — upwards of eight hours for a recent onboarding, and growing with every release.
A new tenant is now created as a file-level copy of a pre-migrated template: no schema statement is re-executed, and the clone starts fully up to date. The cost is the size of the template, not the number of migrations.
- The template is kept level with the live schema as part of the normal upgrade run
- The old path remains the last rung — no template, a stale template or a failed clone all fall back to the full migration run, correct and merely slow, with the reason logged