CREATE TABLE user_authorizations (
    id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(),
    user_id VARCHAR(64) REFERENCES users(id) ON DELETE CASCADE,
    uid VARCHAR(255) NOT NULL,
    provider VARCHAR(255) NOT NULL,
    token VARCHAR(255) NULL,
    token_expiration TIMESTAMP NULL,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX user_authorizations_user_id_idx ON user_authorizations(user_id);


