<?php

return <<<'SQL'
CREATE TABLE survey_answers (
    id CHAR(36) NOT NULL PRIMARY KEY,
    survey_id CHAR(36) NOT NULL,
    question_id CHAR(36) NOT NULL,
    tenant_user_id CHAR(36) NOT NULL,
    answer_text TEXT NULL,
    created_at DATETIME NOT NULL,
    updated_at DATETIME NOT NULL,
    FOREIGN KEY (survey_id) REFERENCES surveys(id),
    FOREIGN KEY (question_id) REFERENCES survey_questions(id),
    FOREIGN KEY (tenant_user_id) REFERENCES tenant_users(id)
);
SQL;
