Internal and public identity
An integer primary key supports compact database joins while
reference_id gives clients a stable UUID reference.
Daptin
Run Daptin →
Data modeling guide
Start with one table, verify the generated storage and interfaces, then add relationships, indexes, and access rules.
First model
Tables:
- TableName: product
Columns:
- Name: name
DataType: varchar(500)
ColumnType: label
IsNullable: false
- Name: price
DataType: float(7,2)
ColumnType: float
Start Daptin with the schema available to the server. Inspect the table in dashboard3, its JSON:API resource, and the discovery metadata before adding production records.
What Daptin adds
An integer primary key supports compact database joins while
reference_id gives clients a stable UUID reference.
created_at, updated_at, and
version support change tracking and server-side
stale-write detection.
user_account_id and the permission field connect
records to Daptin's authorization model.
The model appears through resource APIs, dashboard3, metadata, OpenAPI, and optional GraphQL.
Integrity
Use IsNullable, IsUnique, and
IsIndexed for field-level behavior. Add explicit
relationships instead of storing unverified identifiers in
ordinary text columns.
Relations:
- Subject: comment
Object: post
Relation: belongs_to
For a file column, use text storage with the appropriate file or
image ColumnType and a
ForeignKeyData reference to the intended cloud store.
Do not invent a database-native image type.
Verification