Skip to content

Entity: Event

Represents an event organized by Instituto Padre Jose. Events are displayed on the site to inform visitors about past and upcoming activities.

Fields

FieldTypeNullableDefaultDescription
idserialnoautoPrimary key
namevarchar(255)noEvent name
descriptiontextyesnullOptional event description
datetimestamp with time zonenoDate and time of the event

Standard columns (created_at, updated_at, deleted_at) are inherited per ADR-007 and should not be listed here.

Relations

RelationTypeTarget entityFKOn delete
photosone-to-manyEventPhotoevent_photo.event_idcascade

Business rules

  • An event must have at least one photo.
  • The date field stores the full date and time with timezone.
  • The date must not be in the past (validated at creation time).

Notes

Photos are stored as separate records in event_photo to support multiple images per event. The actual files are stored in Cloudflare R2; the database only keeps the object key.