A useful view that could be included in the default schema.
Nothing useful (at the moment) for MB, but it's been useful to me when scripting
other things using the MB database.
CREATE OR REPLACE VIEW file_hashes AS
SELECT "substring"(file.path::text, '^.+/'::text) AS path,
"substring"(file.path::text, '[^/]+$'::text) AS filename, hash.mtime,
hash.md5hex, hash.sha1hex, hash.sha256hex
FROM hexhash hash
JOIN filearr file ON hash.file_id = file.id;
|