sync-engine icon indicating copy to clipboard operation
sync-engine copied to clipboard

Self-hosted sync engine parent folder reference

Open VinceWilkie opened this issue 8 years ago • 1 comments

The Folder Table: The table itself has no parent references and I haven't found any other tables that reveal parent folder references. I've been trying to design a way to selectively traverse folders by using the name column.

Note: I am currently using version 5.4 of Laravel.

Let's say I have the following folder records: Folder 1 Folder 1/Folder 1.1 Folder 1/Folder 1.2 Folder 1/Folder 1.2/Folder 1.2.1

I've been able to use a combination of like and not like to capture a certain level of folders but it's proven difficult to get it using some kind of Laravel eloquent relationship.

Is there any way a parent folder relationship can added to the folder table? A "parent" column could be added to the folder table that would reference the folder tables id column? Or another (parent folder?) table could have two columns that reference the folder tables id column?

Ideally, I don't want to be selecting all folders to manage hierarchy because there could potentially be thousands of folders.

VinceWilkie avatar Feb 16 '17 17:02 VinceWilkie

A parent column would definitely be helpful in my opinion. Since the folders are being stored as a materialized path having a parent_id field would make it a snap to use in Laravel!

coastermcgee avatar Feb 27 '17 18:02 coastermcgee