CREATE TABLE IF NOT EXISTS tea (
  id serial PRIMARY KEY,
  tea_name VARCHAR(128) NOT NULL,
  rfid_code VARCHAR(128) NOT NULL,
  water_temp INT,
  steeping_seconds INT NOT NULL,
  registration_timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS steepinglog (
  change_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  tea_id INT NOT NULL,
  steeping_seconds INT NOT NULL,
  steeping_tested_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE IF NOT EXISTS config (
  default_steeping_time INT NOT NULL DEFAULT 120,
  feedback_timeout BIGINT NOT NULL DEFAULT 60
);