Skip to content

Dhruv/members table - #12

Open
dhruvnpUNC wants to merge 5 commits into
mainfrom
dhruv/members-table
Open

dhruvnpUNC wants to merge 5 commits into
mainfrom
dhruv/members-table

Conversation

@dhruvnpUNC

Copy link
Copy Markdown
Collaborator

Ticket

Closes #3 Members Table

What changed

  • Implemented members table and member_status enum in the schema
  • Generated drizzle migration file for members (0001_confused_peter_quill.sql)

Why

The members table helps us store relevant information about club members. Having this information easily accessible will help streamline various tasks like, like inviting every member on a project to a github repository as soon as a project team is created.

How to verify

bun run db:migrate was giving me issues so I created a local postgres15 server and verified it manually. I used citext because it handles case insensitivity automatically and is native to PostgreSQL

Screenshot 2026-10-21 at 11 42 04 AM

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 mentioned this pull request Oct 22, 2026
3 tasks done

@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 Dhruv. Using citext was a good choice with a clear reason, and the screenshot shows the case-insensitive uniqueness check the ticket asked for. A few things need fixing before this merges.

Please fix

  • member_status is missing alumni. The TDD 3.1 enum is active | alumni.
  • Missing timestamps. TDD 3.1 needs created_at on every table and updated_at on editable ones. members is editable, so add both: defaultNow(), plus .$onUpdate(() => new Date()) on updated_at.
  • Array columns accept NULL. other_emails, majors and minors default to {}, but you can still insert NULL into them explicitly. Add .notNull() so code reading them can rely on always getting an array.
  • CREATE EXTENSION citext was added to the generated migration by hand. It has no --> statement-breakpoint after it, and Drizzle doesn't know it's there, so it can get lost the next time the migration is regenerated (which is likely, see below). Put it in its own custom migration (bunx drizzle-kit generate --custom --name enable_citext) that runs before the members migration.
  • Revert the .env.example change. Dropping postgres:postgres breaks the default for anyone running outside the devcontainer.

Heads-up

  • Migration clash with #11. #11 also adds a 0001_* migration. If #11 merges first, delete your generated migration files, rebase on main, and run bun run db:generate again. That's another reason to keep the citext extension in its own migration.
  • Testing environment. You mentioned bun run db:migrate failed for you and you tested on a local Postgres 15. The devcontainer runs Postgres 16, which is what we deploy on, so let's get your devcontainer working. Ping me or post the error.
  • PR checklist. It's unchecked. Please run through it and tick the boxes.

Re-request review when it's ready.

@VidurShah

Copy link
Copy Markdown
Collaborator

Not blocking: TDD 3.1 also has a trigram search index on members. It'll come with the members list ticket. Vidur's handling the migration regeneration when this merges.

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.

Members table

2 participants