Skip to content

Conversation

@mosi-kha
Copy link

with this method can create workspace with custom id

@mosi-kha
Copy link
Author

@zak39 Hi, can you review it?

@zak39
Copy link
Collaborator

zak39 commented Dec 1, 2025

Hi @mosi-kha 👋

Thank you for your Pull Request 😉

I don't understand your need.
What is your use case?

The spaceId is automatically incremented.

@mosi-kha
Copy link
Author

mosi-kha commented Dec 1, 2025

@zak39 Hi 👋
Thanks for the review. Our case is that when we want to create a workspace, we must create it with our spaceId, not automatically, because we sync with other tenant schemas/systems. In this PR, I created a method that allows users can also create a workspace by custom spaceId.

@zak39
Copy link
Collaborator

zak39 commented Dec 1, 2025

Do you mean, you have different schemas and systems (MySql? PosgreSQl? Oracle? etc.) synced together, but they don't increment the spaceId when you create a workspace?
Can you give more details about your issue?

What happens when you create a groupfolder outside a workspace context?

https://petstore.swagger.io/?url=https://raw.githubusercontent.com/nextcloud/groupfolders/master/openapi.json#/folder/folder-add-folder

@mosi-kha
Copy link
Author

mosi-kha commented Dec 2, 2025

In our case, we want sync with other service that manage tenant, in that service created tenants id is integer but in retreive and save into workspace, there is no guarantee that the IDs return in order.
with this method, we can insure workspace will created by correct id.

@smarinier
Copy link
Collaborator

@mosi-kha , this is not a recommended way to do so. Tricking the id generation and using direct OCA Workspace classes neither.
You should create a table dedicated to your tenants with a relation tenant_id -> workspace_id. As you're ready to call workspace PHP code, we can guess you've already have a Nextcloud app.
And now, the best way to operate with workspace is to use the OCS public APIs.

Yours,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants