Skip to content

Tables & Enums

Buyer profiles and Lucia user store. All columns become Lucia user attributes.

ColumnTypeNotes
iduuid PKDefault gen_random_uuid()
titletextSalutation (Dr., Prof.)
first_nametext
last_nametext
emailtext UNIQUELogin identifier
phonetext UNIQUELogin identifier
interest_typeinterest_typeNOT NULL
preferred_languagepreferred_languageDefault de
newsletter_opt_inbooleanDefault false
privacy_accepted_attimestamptzNOT NULL
biological_sexbiological_sexOptional
project_iduuid FK → projectsAdded in migration 0009
organization_iduuid FK → organizationsDenormalized in 0015
portal_iduuid FK → portalsLatest portal in 0015
crm_contact_idtextOptional CRM reference

Property units. id is a string (CMS identifier, e.g., top-1).

ColumnTypeNotes
idtext PKCMS/unit identifier
unit_codetextCode unique within project
project_iduuid FK → projectsAdded in migration 0009
titletextNOT NULL
statusunit_statusDefault available
roomsnumeric(4,1)
area_sqmnumeric(8,2)
purchase_price_eurintegerNOT NULL
agent_iduuid FK → agentsAssigned agent
Document filenamestextexpose, floor_plan, energy_certificate

Sales agent profiles, scoped to organizations.

ColumnTypeNotes
iduuid PK
nametextNOT NULL
roletext
emailtext
phonetext
whatsapptextWhatsApp number
avatar_urltextProfile photo URL
organization_iduuid FK → organizationsAdded in migration 0009

Lucia session store for buyer sessions.

ColumnTypeNotes
idtext PKOpaque session ID (40+ chars)
user_iduuid FK → buyersNOT NULL, CASCADE delete
expires_attimestamptzNOT NULL
project_iduuid FK → projectsAdded in migration 0009

Lucia session store for CRM (agent/developer) sessions.

ColumnTypeNotes
idtext PKOpaque session ID
user_iduuid FK → usersNOT NULL, CASCADE delete
expires_attimestamptzNOT NULL
active_project_iduuid FK → projectsCurrent active project

One-time password storage (hash, not plaintext).

ColumnTypeNotes
iduuid PK
identifiertextEmail or phone
code_hashtextSHA-256 hash
channelotp_channelemail or whatsapp
expires_attimestamptz
attemptsintegerDefault 0
usedbooleanDefault false
project_iduuid FK → projectsAdded in migration 0009

organizations, projects, portals, portal_domains

Section titled “organizations, projects, portals, portal_domains”

See Tenant Model for the complete hierarchy.

CRM identities (agents, developers, and buyers if they have CRM access).

ColumnTypeNotes
iduuid PK
emailtext UNIQUELogin identity
nametext
typeuser_typebuyer, agent, or developer

Immutable audit trail for all mutations.

ColumnTypeNotes
iduuid PK
organization_iduuid FK → organizationsFor filtering
project_iduuid FK → projectsFor filtering
actiontexte.g., unit.update, portal.publish
entity_typetextEntity class
entity_idtextEntity UUID
beforejsonbPrevious state (null for creates)
afterjsonbNew state (null for deletes)

Background job queue for the Worker Box.

ColumnTypeNotes
iduuid PK
typejob_typeopenimmo.import, image.label, ecb.refresh
statusjob_statusqueued, running, done, failed
payloadjsonbJob input
resultjsonbJob output