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

1.2 KiB
Raw Blame History

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-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:

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.tsTEST_BUSINESS_ID, TEST_COMPANIES_COUNT
  • database/seeders/cleanup-test-companies.seeder.tsTEST_BUSINESS_ID (must match).