CREATE TABLE notifications (
    id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
    type VARCHAR(32) NOT NULL,
    source_user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE,
    target_user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE,
    band_id VARCHAR(64) REFERENCES bands(id) ON DELETE CASCADE,
    session_id VARCHAR(64) REFERENCES music_sessions(id) ON DELETE CASCADE,
    recording_id VARCHAR(64) REFERENCES recordings(id) ON DELETE CASCADE,
    invitation_id VARCHAR(64) REFERENCES invitations(id) ON DELETE CASCADE,
    join_request_id VARCHAR(64) REFERENCES join_requests(id) ON DELETE CASCADE,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);