change: version infor added to partitions schema

This commit is contained in:
Maksym Buz
2026-02-19 17:02:10 +00:00
parent b1c3cd579d
commit bd15e707cc
2 changed files with 17 additions and 0 deletions

View File

@@ -62,6 +62,12 @@ System state can be monitored via the `partitions.monitoring` view.
SELECT * FROM partitions.monitoring;
```
### Versioning
To check the installed version of the partitioning solution:
```sql
SELECT * FROM partitions.version ORDER BY installed_at DESC LIMIT 1;
```
### Least Privilege Access (`zbx_monitor`)
For monitoring purposes, it is recommended to create a dedicated user with read-only access to the monitoring view.

View File

@@ -15,6 +15,17 @@ CREATE TABLE IF NOT EXISTS partitions.config (
PRIMARY KEY (table_name)
);
-- Table to track installed version of the partitioning solution
CREATE TABLE IF NOT EXISTS partitions.version (
version text PRIMARY KEY,
installed_at timestamp with time zone DEFAULT now(),
description text
);
-- Set initial version
INSERT INTO partitions.version (version, description) VALUES ('1.0', 'Initial release')
ON CONFLICT (version) DO NOTHING;
-- Default configuration for Zabbix tables (adjust as needed)
-- History tables: Daily partitions, keep 30 days
INSERT INTO partitions.config (table_name, period, keep_history) VALUES