Skip to content
This repository was archived by the owner on Oct 5, 2025. It is now read-only.
This repository was archived by the owner on Oct 5, 2025. It is now read-only.

Update database schema #98

@tferracina

Description

@tferracina

The database uses the following schema: there are meta and data tables, while the singular sqlite_master table must not be touched.

The Meta tables are the following.
- metadata: history of updates to the database file, with information on current format version.
- categories: list of tables with their definitions, such as structure or policies of use.
- types: list of data types for the columns of the data tables.

The Data tables are each stored separately, and follow the structure defined in the 'categories' table.

Both meta and data groups of tables must include the following columns, to ensure that history is preserved.
	id INTEGER PRIMARY KEY AUTOINCREMENT,
	created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
	updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
	deleted_at DATETIME,

In both meta and data groups of tables, modifying the contents of a row creates a new row by default, although the code allows for history-less altering. This ensures that versions are easily tracked, and mistakes can be traced back and reverted.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions