DROP TABLE "survey_data";
DROP sequence survey_data_id_seq;

CREATE TABLE "survey_data" (
  "id" SERIAL NOT NULL UNIQUE PRIMARY KEY,
  "sr_id" int NOT NULL CONSTRAINT data_ref_res
    REFERENCES survey_responses(id) ON UPDATE CASCADE ON DELETE RESTRICT,
  "question_id" varchar(64) NOT NULL,
  "text" TEXT
);

CREATE INDEX "sr_id_idx" ON "survey_data" ("sr_id");
