feat(db): add script to create an org with its admin and plan

Adds `db:create-org` which provisions an organization, adds the given
email as a verified admin, and attaches an active plan (BASIC by
default). Creates the user + profile first when the email is unknown,
derives the site name from the org name unless overridden, and supports
a --dry-run preview mode.
This commit is contained in:
Rotimi Best
2026-08-14 01:06:06 +01:00
parent 56c944a74e
commit a93acd0f6d
2 changed files with 160 additions and 0 deletions
+1
View File
@@ -67,6 +67,7 @@
"db:assets-backfill": "tsx src/scripts/backfill-lesson-assets.ts",
"db:rewrite-media-host": "tsx src/scripts/rewrite-media-host.ts",
"db:login-link": "tsx src/scripts/generate-login-link.ts",
"db:create-org": "tsx src/scripts/create-org-with-admin.ts",
"db:sync-orphaned-profiles": "tsx src/scripts/sync-orphaned-profiles.ts",
"db:backfill-profile-email-verification": "tsx src/scripts/backfill-profile-email-verification.ts",
"db:backfill-member-email-notifications": "tsx src/scripts/backfill-member-email-notifications-from-profile.ts",