Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more field for user, how work with database system ? #345

Open
Chuvantinh opened this issue Oct 11, 2021 · 3 comments
Open

add more field for user, how work with database system ? #345

Chuvantinh opened this issue Oct 11, 2021 · 3 comments

Comments

@Chuvantinh
Copy link

Add more field for user 'registration

could you tell me how to add more field in the page of registration ? . for example: the user have more information such as : bank account, address, etc.

one thing I do not understand that how can we work with database system ?
I do not see in the code any model for the tables and do not find any thing on the documents :))

thanks

@nickvergessen
Copy link
Member

The model: https://github.com/nextcloud/registration/blob/master/lib/Db/Registration.php
Database: https://github.com/nextcloud/registration/blob/master/lib/Migration/Version0005Date20200710135953.php
but you can't modify the migration, so you need to generate a new migration file and then do something like:

			$table = $schema->getTable('registration');
			$table->addColumn('your field', Types::STRING, [
				'notnull' => false,
			]);

However the accounts table already has a field for the address, so you could add it there directly, similar like this:
https://github.com/nextcloud/registration/blob/master/lib/Service/RegistrationService.php#L397-L403

@Chuvantinh
Copy link
Author

Thanks, today I tried to create a new table with migration already.
When I create more fields in the page registration, Then I have to add them as JSON String into table accounts.
Thanks for your support. However, we have to modify the form ### on the page of admin such as "create new user". I think, If I do it successfully, we can lose the update of Nextcloud if they release a new version. is that true ? or should I write a new app ?

@hansimausisteffiwurstbrot

Thanks, today I tried to create a new table with migration already. When I create more fields in the page registration, Then I have to add them as JSON String into table accounts. Thanks for your support. However, we have to modify the form ### on the page of admin such as "create new user". I think, If I do it successfully, we can lose the update of Nextcloud if they release a new version. is that true ? or should I write a new app ?

Are you still working on implementing additional fields?

I'm desperately waiting for this feature and we got some money we could offer for implementing it.

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

No branches or pull requests

3 participants