Files
dzone-api/database/seeders/README-TEST-COMPANIES.md
T
2026-02-17 16:04:49 +03:30

39 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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:
```bash
pnpm run build
pnpm run seed:test-companies
```
Requirements:
- Business `e5e760b9-46a5-4194-bb3d-00a46c24d72a` must exist.
- At least one **Industry** must exist for that business (create one in the app if needed).
- **Role** `USER` must exist (run `pnpm run seed:run` once if you havent).
## 2. After testing: remove test data
Same DB, same business:
```bash
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_COUNT`
- `database/seeders/cleanup-test-companies.seeder.ts``TEST_BUSINESS_ID` (must match).