Issue64

Title a new sql view for files with separate paths and filenames
Priority feature Status chatting
Superseder Nosy List fukawi2, poeml
Assigned To Keywords

Created on 2010-09-17.11:47:09 by fukawi2, last changed by poeml.

Messages
msg258 (view) Author: poeml Date: 2010-09-18.22:06:52
Very nice.

This needs to go into sql/schema-postgresql.sql.

For upgrading, there is no proper infrastructure. mb/mb/conn.py contains the code that 
loads the ORM (object relational mapper) models, and I used that for the last big 
upgrade (2.13.0). If the hashes table doesn't exist, it is created (among other 
things).

Better would be to have a little table with a version number. That could be checked at 
each start with low overhead. Depending on the version number, needed upgrades could 
be performed.

That should be solved first I think. Otherwise the mess that I already created becomes 
even messier.

But as it seems trivial to implement to me, I don't think it's a significant hurdle. 
(It just prevents me from including the new view right now...)
msg242 (view) Author: fukawi2 Date: 2010-09-17.11:47:08
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;
History
Date User Action Args
2010-09-18 22:06:52poemlsetstatus: unread -> chatting
nosy: + poeml
messages: + msg258
2010-09-17 11:47:09fukawi2create