ALTER TABLE files_nodes
    DROP CONSTRAINT IF EXISTS files_nodes_file_storage_check;

ALTER TABLE files_nodes
    ADD CONSTRAINT files_nodes_file_storage_check CHECK (
        node_type IN ('folder', 'google_sheet', 'office_document') OR storage_key IS NOT NULL
    );
