CREATE TABLE users_favorites (
    id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
    user_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    recording_id VARCHAR(64) NOT NULL REFERENCES recordings(id) ON DELETE CASCADE,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

ALTER TABLE users_favorites ADD CONSTRAINT user_favorite_uniqkey UNIQUE (user_id, recording_id);
