diff --git a/backend/migrations/000007_create_participants_table.up.plsql b/backend/migrations/000007_create_participants_table.up.plsql index c202539..92dc15a 100644 --- a/backend/migrations/000007_create_participants_table.up.plsql +++ b/backend/migrations/000007_create_participants_table.up.plsql @@ -1,6 +1,7 @@ CREATE TABLE participants( - user_id bigserial NOT NULL, - event_id bigserial NOT NULL, + id bigserial NOT NULL PRIMARY KEY, + user_id bigint NOT NULL, + event_id bigint NOT NULL, status text NOT NULL, created_at timestamp WITH TIME ZONE NOT NULL -); \ No newline at end of file +); diff --git a/backend/pkg/models/participants.go b/backend/pkg/models/participants.go index 1220332..b58ff7b 100644 --- a/backend/pkg/models/participants.go +++ b/backend/pkg/models/participants.go @@ -1,8 +1,7 @@ package models -// TODO: Add Status as Postgres ENUM - type Participant struct { + ID uint64 `gorm:"column:id"` UserID uint64 `gorm:"column:user_id" json:"user_id,omitempty"` EventID uint64 `gorm:"column:event_id" json:"event_id,omitempty"` Status string `gorm:"column:status" json:"status,omitempty"`