You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title a new sql view for files with separate paths and filenames
Priority feature Status chatting
Superseder Nosy List fukawi2, poeml
Assigned To Keywords
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;
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...)
History
Date User Action Args
status: unread -> chatting
2010-09-18 22:06:52 poeml set nosy: + poeml
messages: + msg258
2010-09-17 11:47:09 fukawi2 create
(end of migrated issue)
The text was updated successfully, but these errors were encountered:
Issue migrated (2015-06-05) from old issue tracker http://mirrorbrain.org/issues/issue64
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;
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...)
(end of migrated issue)
The text was updated successfully, but these errors were encountered: