File update time fix


(Peter Sheppard) #1

If you followed the standard upgrade instructions before bug #4064 caused them to be changed, then the "last modified date" of all file assets in your system will show as the time you did the upgrade.


To reset the times, run the following SQL query:


    select 'touch -t ' || to_char(from_date, 'YYYYMMDDHHMI') || ' ' || path || '/' || replace(replace(filename, ')', '\\)'), '(', '\\(') as output
    from sq_ast a
    inner join sq_file_vers_file f on split_part(f.path, '/', 4) = a.assetid
    inner join sq_file_vers_history h on f.fileid = h.fileid and h.to_date is null and removal = 0


Save the output as a shell script, change the permissions etc, and run it from
[SYSTEM_ROOT]/data/private/

This will "touch" all the files to the correct time, as stored in the file versioning history table.