steffenfritz / FileTrove

FileTrove indexes files and creates metadata from them.
https://filetrove.fritz.wtf
GNU Affero General Public License v3.0
28 stars 5 forks source link

[CHANGE] Add Parent UUID to Files and Directories #26

Open dla-kramski opened 6 months ago

dla-kramski commented 6 months ago

Apart from the name, there is currently no connection between the files and their directories.

Files and directories could carry the UUID of their (parent) directories in order to formally map the hierarchy.

steffenfritz commented 6 months ago

Yes, I like that idea. Milestone for v1.0.0.

steffenfritz commented 5 months ago

As the concatenation of every UUID for every directory might be a very long string and might not add extra value as every directory has its own UUID, I suggest not to add the parent UUID to directories but concatenate SESSION-UUID:DIRECTORY-UUID:FILE-UUID

But: This would take a lot of comparisons and lookups. As the path of the file is in the filepath and a path must be unique in one session, SESSION-UUID:FILE-UUID connects all of the requirements.

As the session UUID is stored in file table the information is already in the database the following sql should be sufficient:

SELECT sessionuuid || ':' || fileuuid FROM files;

Opinions, @dla-kramski ?

hkramski commented 5 months ago

I'm not sure I understand your suggestion. I just thought of an additional column Parent_UUID for files and directories.

steffenfritz commented 5 months ago

As this makes only sense after aligning to the Wikidata data model, this will be done after #30 . As absolute paths are used, the parent object, i.e. directory, is clear in the current usage of filename.