INSERT INTO stor.t_storage_responsible_person_link (
    storageresponsiblepersonlinkid, storage, post, datebegin, dateend
)
SELECT
    gen_random_uuid(),
    s.storageid,
    s.responsibleperson,
    CURRENT_DATE,
    NULL
FROM stor.t_storage s
WHERE s.responsibleperson IS NOT NULL;
