-- recordings
CREATE TABLE recordings_comments(
    id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
    recording_id VARCHAR(64) NOT NULL REFERENCES recordings(id) ON DELETE CASCADE,
    creator_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    comment VARCHAR(4000) NOT NULL,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

-- sessions
CREATE TABLE music_sessions_comments (
    id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
    music_session_id VARCHAR(64) NOT NULL REFERENCES music_sessions(id) ON DELETE CASCADE,
    creator_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    comment VARCHAR(4000) NOT NULL,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);