TenantAtlas/specs/999-seeder-external-id/spec.md

644 B

999 - Fix seeding: tenants.external_id not-null

Problem

Running php artisan migrate:fresh --seed fails with:

  • SQLSTATE[23502]: Not null violation: null value in column "external_id" of relation "tenants"

The failing insert is from Database\Seeders\PoliciesSeeder creating a default tenant without populating external_id.

Goal

  • migrate:fresh --seed succeeds on a clean database.

Non-goals

  • No changes to production data or existing tenant records.

Acceptance Criteria

  • Seeding succeeds with PostgreSQL.
  • A default tenant is created with a valid external_id.
  • Tests covering the seeding path (minimal) pass.