mirror of
https://github.com/tiennm99/postgresql-keepalive.git
synced 2026-05-20 10:24:55 +00:00
Update init.sql
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user