-- +goose Up
-- +goose StatementBegin
CREATE TABLE question (
  id INTEGER PRIMARY KEY,
  survey_id INTEGER,
  question TEXT UNIQUE NOT NULL,
  result INTEGER DEFAULT 0);

CREATE TABLE survey (
  id INTEGER PRIMARY KEY,
  title TEXT UNIQUE NOT NULL,
  description TEXT UNIQUE NOT NULL,
  created_on DATETIME DEFAULT CURRENT_TIMESTAMP,
  respondents INTEGER DEFAULT 0,
  active BOOLEAN INTEGER DEFAULT false);
-- +goose StatementEnd

-- +goose Down
-- +goose StatementBegin
DROP TABLE IF EXISTS question;
DROP TABLE IF EXISTS survey;
-- +goose StatementEnd
