Skip to content

[Sharing 2.0] Add a new db column for the file owner - #20703

Merged
DeepDiver1975 merged 1 commit into
masterfrom
share2.0_fileowner_column
Nov 25, 2015
Merged

DeepDiver1975 merged 1 commit into
masterfrom
share2.0_fileowner_column

Conversation

@rullzer

@rullzer rullzer commented Nov 24, 2015

Copy link
Copy Markdown
Contributor

This column is required since we make flat reshares. For the owner of the file we want to know all the files that are shared. Even if they are shared by someone we gave reshare permissions on a file.

Without this field we have to construct the path for each fileid in the share table and figure out the owner. This does not scale at all!

The field is currently not in use. But hopefully soon ;)

CC: @DeepDiver1975 @schiesbn @nickvergessen @PVince81

For #19331

@rullzer rullzer added this to the 9.0-current milestone Nov 24, 2015
@PVince81

Copy link
Copy Markdown
Contributor

So the file owner is not the same as the file sharer ?
I'd think the entry of a flat share always originates from the owner, and reshares just "attach" themselves as members of that original share ?

@rullzer

rullzer commented Nov 24, 2015

Copy link
Copy Markdown
Contributor Author

So the file owner is not the same as the file sharer ?
I'd think the entry of a flat share always originates from the owner, and reshares just "attach" themselves as members of that original share ?

No the owner of a file does not have to the one that initiated the share. Assume user0 shares a folder with user1 and user1 shares a subfolder of that with user2.

Now user1 created the share. But user0 owns the shares (because they own the file).

Of course we could turn this around and say the current uid_owner field is the owner of the share. And we add a new field for the user that initated the share (so we can show to the onwer subfolder shared with user2 by user1).

But this way we avoid having to do manual migration of the shares table. Since currently the uid_owner is the initated of the share and that does not have to be the owner of the files.

@PVince81

Copy link
Copy Markdown
Contributor

Ok, got it. The sub-item reshares is always the most complicated stuff.

Fine by me 👍

@rullzer

rullzer commented Nov 24, 2015

Copy link
Copy Markdown
Contributor Author

Mmmm for some reason oracle chokes on this...

@rullzer
rullzer force-pushed the share2.0_fileowner_column branch from 12f59a5 to 756d479 Compare November 24, 2015 14:15
Comment thread db_structure.xml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default is empty string,
empty string is null on oracle
but notnull does not allow null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, you just fixed it I think

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes :)

@rullzer

rullzer commented Nov 24, 2015

Copy link
Copy Markdown
Contributor Author

YAY everything is green!

@DeepDiver1975

Copy link
Copy Markdown
Contributor

👍

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@schiesbn please review - THX

@schiessle

Copy link
Copy Markdown
Contributor

'uid_owner' and 'uid_fileowner' sounds quite confusing for someone who looks at the table for the first time. Can we add at least to the xml file a <comment> tag with a short description of both columns?

Beside that minor detail... 👍

@rullzer

rullzer commented Nov 25, 2015

Copy link
Copy Markdown
Contributor Author

'uid_owner' and 'uid_fileowner' sounds quite confusing for someone who looks at the table for the first time. Can we add at least to the xml file a tag with a short description of both columns?

Yes let me add

@rullzer
rullzer force-pushed the share2.0_fileowner_column branch from 756d479 to 10a2645 Compare November 25, 2015 10:41
@rullzer

rullzer commented Nov 25, 2015

Copy link
Copy Markdown
Contributor Author

Comment added.

@schiessle

Copy link
Copy Markdown
Contributor

👍

Comment thread db_structure.xml Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iniated = initiator?

@rullzer
rullzer force-pushed the share2.0_fileowner_column branch from c5e709c to 5e8256b Compare November 25, 2015 12:16
@rullzer

rullzer commented Nov 25, 2015

Copy link
Copy Markdown
Contributor Author

Thanks @PhSc!

We need to store the owner of a file in the db to do efficient queries
on the owner of a file. Without this we need to construct fill paths for
each file id in the table and see who the owner of a file is. Which does
not scale.
DeepDiver1975 added a commit that referenced this pull request Nov 25, 2015
[Sharing 2.0] Add a new db column for the file owner
@DeepDiver1975
DeepDiver1975 merged commit 67766dc into master Nov 25, 2015
@DeepDiver1975
DeepDiver1975 deleted the share2.0_fileowner_column branch November 25, 2015 14:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants