Group my users?

Yes, you can fill app_metadata using your legacy database, but keep in mind this part when writing your script:

If setting app_metadata , call it metadata in the script. To support backwards compatibility, app_metadata is called metadata in custom DB scripts.

Exactly. The Auth0 datastore isn’t designed to hold that group type data. If you need it in your login ticket, you could use a rule to fetch the data during login. The Auth0 Authorization Extension works the same way.