-- Create the streamkap schema
CREATE SCHEMA IF NOT EXISTS streamkap;
-- Switch to the streamkap schema
USE streamkap;
-- Create the heartbeat table with id, text, and last_update fields
CREATE TABLE streamkap_heartbeat (
id INT AUTO_INCREMENT PRIMARY KEY,
text TEXT,
last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Grant permission to the Streamkap user
GRANT SELECT, INSERT, UPDATE ON streamkap.streamkap_heartbeat TO STREAMKAP_USER;
-- Insert the first row into the heartbeat table
INSERT INTO streamkap_heartbeat (text) VALUES ('test_heartbeat');