DO $$ 
BEGIN
		BEGIN
          IF EXISTS (SELECT "Id" FROM public."Versions" WHERE "Build">=1977) THEN
		RETURN;
          END IF;
		 
 
		ALTER TABLE public."DocumentDirectories"  ADD "AuthorId" bigint NULL;
		UPDATE public."DocumentDirectories"  SET "AuthorId" = "OwnerId";
		
		EXCEPTION
            WHEN OTHERS THEN RAISE NOTICE 'Alter table <DocumentDirectories> error.';
        END;
   
END$$

