+/- table definition

Query

CREATE TABLE credit_transactions  (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  user_id INTEGER NOT NULL,
  chatbot_id INTEGER,
  amount_delta INTEGER NOT NULL,
  reason TEXT NOT NULL,
  reference_id TEXT NOT NULL UNIQUE,
  created_at TEXT NOT NULL,
  FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
  FOREIGN KEY (chatbot_id) REFERENCES chatbots(id) ON DELETE SET NULL
)
Use Shift + Up/Down to navigate recently-executed queries