Skip to main content

Database Schema

Entities -Attendance Management

Table: Attendance

Column NameData TypeDetails
attendancevarcharNOT NULL, must be one of (present, absent, on-leave)
remarkvarchar(255)Optional
imagevarchar(500)Optional
metaDatavarcharOptional
syncTimevarcharOptional
sessionvarcharOptional
contextIduuidNOT NULL
contextvarchar(255)NOT NULL
createdAttimestamptzDefaults to current timestamp
updatedAttimestamptzDefaults to current timestamp
attendanceIduuidNOT NULL, Primary Key, defaults to gen_random_uuid()
tenantIduuidNOT NULL
userIduuidNOT NULL
attendanceDatedateNOT NULL, defaults to current date
latitudefloat8Optional
longitudefloat8Optional
createdByuuidOptional
updatedByuuidOptional
scopepublic.attendance_scopeOptional

Indexes

  • Attendance_tenant: Hash index on tenantId.
  • Attendance_userId: Hash index on userId.

Constraints

  1. Primary Key: PK_Attendance_attendanceId on attendanceId.
  2. Check Constraint: attendance must be one of present, absent, or on-leave.

Triggers

  • set_public_Attendance_updatedAt: Trigger to update updatedAt timestamp before any update operation.

NotificationLogs