Storage Format
Data Table Storage
When the data source type of a data table is default, the system will create a real data table for it and automatically create the following two fields:
| Field | Type | Description |
|---|---|---|
| id | varchar(32) | System-generated unique ID, primary key |
| seq | int(8) | Order of data addition |
The ID of the data table is z_appId_tableId where appId is the application ID and tableId is a 12-digit unique ID generated by the system.
Notes
Most database management tools sort tables by table ID. The z_ prefix distinguishes system tables from tables generated by Informat, making it easier for administrators to view.
Data Table View in Database
In the database table structure generated by the system, both table names and field names are internal IDs, which have poor readability when directly accessing the database. When creating database tables, Informat automatically creates a view for each data table using its identifier.
Notes
If a data table is dependent on another application's data table, Informat will also automatically create a view.
View Example
Table name: z_appid_xju88c8halqop, data table identifier: demoTable
| Column Name | Identifier | Note |
|---|---|---|
| id | id | System-generated primary key |
| caczccdcd882p | name | Name |
| o8n0ezwhf1rmk | maxAge | Maximum Age |
Generated view name: v_appid_demo_table
| Column Name | Note |
|---|---|
| id | System-generated primary key |
| name | Name |
| max_age | Maximum Age |
Notes
Since tables and fields in the database are case-insensitive, when generating views, Informat converts uppercase letters in identifiers to lowercase letters. For readability, underscores _ are used to separate two words. For example, if the identifier is maxAge, the generated view column name is max_age.
Change Log Table
For data tables with record change logging or comments enabled, the system automatically creates a change log table for each table to record field changes.
The name of the change log table is z_appId_tableId_changelog
The structure of the change log table is as follows:
| Field | Type | Description |
|---|---|---|
| id | int | Auto-increment primary key |
| record_id | varchar | Record ID |
| field_id | varchar | ID of the changed field |
| field_name | varchar | Name of the changed field |
| before_value | jsonb | Field value before change |
| after_value | jsonb | Field value after change |
| create_user_id | varchar | ID of the creator |
| create_time | date | Creation time |
before_value and after_value structure:
interface ValueChange {
/**
* Field type, e.g., SingleText
*/
type: string;
/**
* Whether the field value is multi-select
*/
multiple: boolean;
/**
* Field value
*/
value: object;
/**
* String form of the field value
*/
valueString: string;
}Comment Table
For data tables with comments enabled, the system automatically creates a comment table for each table to record user comments.
The name of the comment table is z_appId_tableId_comment
The structure of the comment table is as follows:
| Field | Type | Description |
|---|---|---|
| id | int | Auto-increment primary key |
| record_id | varchar | Record ID |
| parent_id | int | Parent node ID of the comment, used to record which comment this is a reply to |
| comment | text | Comment content |
| is_deleted | bool | Whether the comment is deleted |
| create_user_id | varchar | ID of the creator |
| create_time | date | Creation time |

