ื“ืœื’ ืœืชื•ื›ืŸ ื”ืจืืฉื™

Database Overview

Ever Gauzy supports multiple databases and ORMs, providing flexibility for different deployment scenarios.

Supported Databasesโ€‹

DatabaseProductionDevelopmentDefault
PostgreSQLโœ… Recommendedโœ…โŒ
MySQL / MariaDBโœ…โœ…โŒ
SQLiteโš ๏ธ Demo onlyโœ…โœ…
better-sqlite3โš ๏ธ Demo onlyโœ…โŒ

Supported ORMsโ€‹

ORMRoleConfiguration
TypeORMPrimary ORMDB_ORM=typeorm
MikroORMAlternative ORMDB_ORM=mikro-orm
KnexQuery builderAlways available

Database Configurationโ€‹

Core Environment Variablesโ€‹

# Database type
DB_TYPE=postgres # postgres | mysql | sqlite | better-sqlite3

# ORM selection
DB_ORM=typeorm # typeorm | mikro-orm

# Connection settings
DB_HOST=localhost
DB_PORT=5432
DB_NAME=gauzy
DB_USER=postgres
DB_PASS=your-password
DB_SSL_MODE=false

# Connection pool
DB_POOL_SIZE=40
DB_CONNECTION_TIMEOUT=5000
DB_IDLE_TIMEOUT=10000

# Logging
DB_LOGGING=false # true | false | query | error | schema

SQLite Configurationโ€‹

For development with SQLite:

DB_TYPE=sqlite
DB_NAME=gauzy.sqlite3

SQLite requires no host, port, user, or password settings.

PostgreSQL Configurationโ€‹

DB_TYPE=postgres
DB_HOST=localhost
DB_PORT=5432
DB_NAME=gauzy
DB_USER=postgres
DB_PASS=root
DB_SSL_MODE=false

MySQL Configurationโ€‹

DB_TYPE=mysql
DB_HOST=localhost
DB_PORT=3306
DB_NAME=gauzy
DB_USER=root
DB_PASS=root

Database Schemaโ€‹

The platform has approximately 200+ database tables organized into domains:

Core Tablesโ€‹

TableEntityDescription
tenantTenantMulti-tenant root
userUserUser accounts
roleRoleRole definitions
role_permissionRolePermissionRole-permission mappings
organizationOrganizationOrganizations within tenants

HRM Tablesโ€‹

TableEntityDescription
employeeEmployeeEmployee profiles
time_logTimeLogTime tracking entries
timesheetTimesheetWeekly/monthly timesheets
time_slotTimeSlot10-minute activity slots
screenshotScreenshotActivity screenshots
activityActivityApp/URL activity tracking
time_off_requestTimeOffRequestLeave requests
time_off_policyTimeOffPolicyLeave policies

PM Tablesโ€‹

TableEntityDescription
organization_projectOrganizationProjectProjects
taskTaskTask management
task_statusTaskStatusCustom task statuses
task_priorityTaskPriorityCustom priorities
organization_sprintOrganizationSprintSprint management
organization_project_moduleProjectModuleProject modules

ERP Tablesโ€‹

TableEntityDescription
invoiceInvoiceInvoices and estimates
invoice_itemInvoiceItemInvoice line items
expenseExpenseExpense records
paymentPaymentPayment records
incomeIncomeIncome records

CRM / ATS Tablesโ€‹

TableEntityDescription
organization_contactOrganizationContactContacts/leads
pipelinePipelineSales pipelines
pipeline_stagePipelineStagePipeline stages
candidateCandidateJob candidates
candidate_interviewCandidateInterviewInterview schedule

Integration Tablesโ€‹

TableEntityDescription
integrationIntegrationActive integrations
integration_typeIntegrationTypeAvailable integration types
integration_settingIntegrationSettingIntegration configs
integration_entity_settingIntegrationEntitySettingEntity sync settings

Entity Relationshipsโ€‹

Tenant โ”€โ”€โ”ฌโ”€โ”€ Organization โ”€โ”€โ”ฌโ”€โ”€ Employee โ”€โ”€โ”€โ”€ TimeLog
โ”‚ โ”œโ”€โ”€ Project โ”€โ”€โ”€โ”€ Task
โ”‚ โ”œโ”€โ”€ Contact
โ”‚ โ”œโ”€โ”€ Invoice
โ”‚ โ””โ”€โ”€ Expense
โ”‚
โ”œโ”€โ”€ User โ”€โ”€โ”€โ”€ Role โ”€โ”€โ”€โ”€ RolePermission
โ”‚
โ””โ”€โ”€ Integration

Database Initializationโ€‹

Auto-Migrationโ€‹

TypeORM can automatically synchronize the schema:

DB_SYNCHRONIZE=true     # โš ๏ธ Development only - drops/recreates tables
warning

Never enable DB_SYNCHRONIZE=true in production. Use migrations instead.

Seedingโ€‹

The platform includes seed data for demo/development:

yarn seed:all           # Seed all demo data
yarn seed:module:all # Seed module-specific data

See Database Seeding for details.