Can anyone guide me about the code to add custom fields from registration form

Hello! I am trying to import registrants csv file but with more than 6 columns and with custom fields as well. Can anyone guide me where the code resides of adding custom fields to database and which all tables in database will be used?

This is quite tricky in the current indico versions. You can take a look at [WIP] Improve registration im/export by bpedersen2 · Pull Request #3475 · indico/indico · GitHub that expands the import functionality, but needs some more work for the current state of indico.