Skip to content

Commit

Permalink
fix: add default role when creating participant
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaniswara committed May 7, 2024
1 parent ef2b5d7 commit ee7bc99
Show file tree
Hide file tree
Showing 4 changed files with 513 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/(server)/_features/event/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const participant = pgTable(
.references(() => events.id, { onDelete: 'cascade' }),
updateCount: integer('update_count').notNull().default(0),
roleID: integer('role_id')
.default(1)
.references(() => participantRole.id, {
onDelete: 'set null',
})
Expand Down
1 change: 1 addition & 0 deletions migrations/0025_add_default_role.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "events_participant" ALTER COLUMN "role_id" SET DEFAULT 1;
Loading

0 comments on commit ee7bc99

Please sign in to comment.