Default database tables and naming rules
All tables and columns in lattenoir follow a fixed naming convention.
Predefined column names:
| Column name | Datatype | Required | Description |
|---|---|---|---|
| id | bigserial primary key | + | Unique primary key, all tables must contain it and it must be named "id" |
| ordering | bigserial not null unique | Field for automatic ordering and sorting of entries in admin panel and not only | |
| enabled | integer not null or boolean not null | Filtering flag - show entry or hide it. In admin panel always show as boolean (YES/NO) | |
| date_cr | timestamp default now() | Entry creation timestamp | |
| user_cr_id | bigint not null references Tusers | User created entry (automatically managed in models only) | |
| date_mo | timestamp | Entry modification timestamp (automatically managed in models only) | |
| *_id | bigint references .... | Foreign keys column must be suffixed with _id |
Fields of localization sub tables, all of them are mandatory:
| Column name | Datatype | Description |
|---|---|---|
| id | bigserial primary key | Unique primary key |
| fid_id | bigint not null references Tsome_main_table | Field to reference a main table |
| l10n_id | bigint not null references Tl10n | Field to reference language |
| Any other localizable fields |