Skip to content

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

Open

Description

@Chuvantinh

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

Activity

  1. nickvergessen commented on Oct 11, 2021

    @nickvergessen
    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

  2. Chuvantinh commented on Oct 12, 2021

    @Chuvantinh
    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 ?

  3. hansimausisteffiwurstbrot commented on Dec 3, 2022

    @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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions