Skip to content

fix(seed): set organization_id on all seed data#94

Merged
NicholaiVogel merged 1 commit intomainfrom
fix/seed-org-ownership
Feb 16, 2026
Merged

fix(seed): set organization_id on all seed data#94
NicholaiVogel merged 1 commit intomainfrom
fix/seed-org-ownership

Conversation

@NicholaiVogel
Copy link
Copy Markdown
Contributor

Summary

  • Add organization_id = 'org-1' (Open Range Construction) to all customer, vendor, and project INSERTs in seed.sql
  • Add idempotent UPDATE statements at the bottom to backfill existing orphaned rows

Context

When multi-tenancy was added, all server actions started filtering by organization_id. But the seed data in seed.sql never included it, so all HPS projects, customers, and vendors had NULL organization_id and were invisible to every query.

Test plan

  • Re-run seed: sqlite3 <db-path> < drizzle/seed.sql
  • Verify projects/customers/vendors appear in Open Range Construction org
  • Re-run seed again to confirm idempotency (no errors)

Customers, vendors, and projects were inserted without
organization_id, making them invisible to org-scoped queries
after multi-tenancy was added. All seed rows now belong to
org-1 (Open Range Construction).

Includes UPDATE statements at the bottom so re-running the
seed fixes existing orphaned rows.
@NicholaiVogel NicholaiVogel merged commit a0afbf3 into main Feb 16, 2026
6 of 10 checks passed
@NicholaiVogel NicholaiVogel deleted the fix/seed-org-ownership branch February 16, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant