change: version infor added to partitions schema
This commit is contained in:
@@ -62,6 +62,12 @@ System state can be monitored via the `partitions.monitoring` view.
|
|||||||
SELECT * FROM partitions.monitoring;
|
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`)
|
### Least Privilege Access (`zbx_monitor`)
|
||||||
For monitoring purposes, it is recommended to create a dedicated user with read-only access to the monitoring view.
|
For monitoring purposes, it is recommended to create a dedicated user with read-only access to the monitoring view.
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,17 @@ CREATE TABLE IF NOT EXISTS partitions.config (
|
|||||||
PRIMARY KEY (table_name)
|
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)
|
-- Default configuration for Zabbix tables (adjust as needed)
|
||||||
-- History tables: Daily partitions, keep 30 days
|
-- History tables: Daily partitions, keep 30 days
|
||||||
INSERT INTO partitions.config (table_name, period, keep_history) VALUES
|
INSERT INTO partitions.config (table_name, period, keep_history) VALUES
|
||||||
|
|||||||
Reference in New Issue
Block a user