Database Schema Reference¶
Status: Implemented
Overview¶
This document describes the database objects currently implemented in the Nivron platform. It serves as the authoritative reference for schemas, tables and their responsibilities.
Schemas¶
| Schema | Purpose |
|---|---|
core |
Platform metadata and tenant foundation. |
identity |
Identity and access entities. |
Table: core.platform_metadata¶
Purpose¶
Stores metadata describing the running platform.
Main Columns¶
| Column | Description |
|---|---|
| product | Product name. |
| component | Running component. |
| version | Software version. |
| environment | Runtime environment. |
Table: core.organizations¶
Purpose¶
Represents an organization (tenant) managed by the platform.
Main Columns¶
| Column | Description |
|---|---|
| id | Internal numeric identifier. |
| uuid | Public UUID v7 identifier. |
| slug | Unique organization slug. |
| name | Display name. |
| status | Lifecycle status. |
| created_at | Creation timestamp. |
| updated_at | Last update timestamp. |
Table: identity.users¶
Purpose¶
Represents platform users.
Main Columns¶
| Column | Description |
|---|---|
| id | Internal identifier. |
| uuid | Public UUID v7 identifier. |
| organization_id | References core.organizations. |
| username | Login name. |
| status | User lifecycle state. |
| created_at | Creation timestamp. |
| updated_at | Last update timestamp. |
Relationships¶
erDiagram
ORGANIZATIONS ||--o{ USERS : owns
ORGANIZATIONS {
bigint id
uuid uuid
}
USERS {
bigint id
bigint organization_id
uuid uuid
}
Migration Source¶
Current database structure is created through:
- 0001_platform_schemas
- 0002_core_platform_metadata
- 0003_core_organizations
- 0004_identity_users
Design Principles¶
- Domain-oriented schemas.
- Immutable migrations.
- UUID v7 for external references.
- Tenant-first data model.
Next Step¶
Continue with Framework Reference for package-level implementation details.