Skip to content

Added positions table and default seed - #11

Open
AnujP75 wants to merge 2 commits into
mainfrom
anuj/positions-table
Open

AnujP75 wants to merge 2 commits into
mainfrom
anuj/positions-table

Conversation

@AnujP75

@AnujP75 AnujP75 commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Ticket

Closes #2

What changed

  • Added positions table and positions category enum in the schema
  • Created Drizzle migration for positions
  • Added seed script that checks for duplications
  • Updated documentation for seed

Why

Adding positions to database will allow members to be assigned positions

How to verify

  • bun run db:migrate
  • bun run db:seed
  • psql "$DATABASE_URL" -c 'SELECT count(*) FROM positions;'
  • bun run db:seed
  • psql "$DATABASE_URL" -c 'SELECT count(*) FROM positions;'

No duplicate rows are added

Screenshots

No UI changes

Checklist

  • CI passes locally (format, lint, typecheck, tests, build)
  • TDD updated if behavior changed (‼️ removed for anything now built)
  • No secrets or real member data in the diff

@VidurShah VidurShah left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Anuj, this is close. The schema matches TDD 2.1/3.1, the seed is idempotent with onConflictDoNothing on name, and the README has the new command.

Please fix

  • updated_at never changes. It gets defaultNow() on insert, but nothing updates it after that. Add .$onUpdate(() => new Date()) so Drizzle sets it on every update.
  • seat_limit has no lower bound. Add a check constraint so it's either NULL (unlimited) or greater than 0. A seat limit of 0 or less would block every assignment.
  • Developer position name. It's seeded as "Developer (backend / frontend / fullstack)". Make it just "Developer". The subrole is stored separately in member_positions.dev_subrole (TDD 3.1), so it shouldn't be part of the name.

Heads-up

  • Migration clash with #12. #12 also adds a 0001_* migration. If this merges first, #12 will regenerate on top of it, so you shouldn't need to do anything. If #12 lands first, delete your migration files, rebase on main, and run bun run db:generate again. Don't edit the journal by hand.
  • PR checklist. It's unchecked. Please run through it (CI passes locally, TDD ‼️ markers removed for positions, no secrets) and tick the boxes.

Re-request review when it's ready.

@VidurShah VidurShah mentioned this pull request Oct 22, 2026
3 tasks
@AnujP75
AnujP75 requested a review from VidurShah October 22, 2026 17:10
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.

Positions table + default seed

2 participants