Update init.sql

This commit is contained in:
2025-11-27 23:05:02 +07:00
parent 6b462d31be
commit d3e780d4a2
+9 -2
View File
@@ -14,11 +14,15 @@ END IF;
END
$do$;
-- Grant full permissions on this database
-- Grant privileges on the database
GRANT ALL PRIVILEGES ON DATABASE keepalive TO keepalive;
-- Connect to the database
\c keepalive;
\c keepalive
-- Ensure the user can use the public schema
GRANT USAGE ON SCHEMA public TO keepalive;
GRANT CREATE ON SCHEMA public TO keepalive;
-- Create the table for key/value counters
CREATE TABLE IF NOT EXISTS keepalive (
@@ -26,6 +30,9 @@ CREATE TABLE IF NOT EXISTS keepalive (
value BIGINT NOT NULL
);
-- Grant all privileges on the table to the user
GRANT ALL PRIVILEGES ON TABLE keepalive TO keepalive;
-- Initialize key/value
INSERT INTO keepalive (key, value)
VALUES ('counter', 0)