fix: automatic column additions, permissions grants and docs updates for seamless upgrades

This commit is contained in:
Maksym Buz
2026-05-05 17:56:57 +00:00
parent 345495eaf5
commit 96c087b920
6 changed files with 75 additions and 25 deletions

View File

@@ -15,6 +15,14 @@ CREATE TABLE IF NOT EXISTS partitions.config (
PRIMARY KEY (table_name)
);
-- Ensure the future_partitions column exists for users upgrading from older versions
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = 'partitions' AND table_name = 'config' AND column_name = 'future_partitions') THEN
ALTER TABLE partitions.config ADD COLUMN future_partitions integer NOT NULL DEFAULT 5;
END IF;
END $$;
-- Table to track installed version of the partitioning solution
CREATE TABLE IF NOT EXISTS partitions.version (
version text PRIMARY KEY,