1.2 KiB
1.2 KiB
Test companies seed (production-safe)
Add about 1000 test companies for a specific business, then remove them in one go.
- Business ID:
e5e760b9-46a5-4194-bb3d-00a46c24d72a - All test rows use the prefix
TEST_SEED_(company name, emails, etc.) so they are easy to identify and delete without touching real data.
1. Seed test companies
From project root:
pnpm run build
pnpm run seed:test-companies
Requirements:
- Business
e5e760b9-46a5-4194-bb3d-00a46c24d72amust exist. - At least one Industry must exist for that business (create one in the app if needed).
- Role
USERmust exist (runpnpm run seed:runonce if you haven’t).
2. After testing: remove test data
Same DB, same business:
pnpm run seed:cleanup-test-companies
This soft-deletes all companies whose name starts with TEST_SEED_ and their linked users for that business. No schema changes, no hard deletes.
Changing business ID or count
Edit the constants at the top of:
database/seeders/test-companies.seeder.ts—TEST_BUSINESS_ID,TEST_COMPANIES_COUNTdatabase/seeders/cleanup-test-companies.seeder.ts—TEST_BUSINESS_ID(must match).