I have used phx.gen.auth to create User schema and the Accounts context. The table is the standard: users.
I would like to add one additional column user_profile_id (integer) into the users table to link to the users_profile table with additional user info.
My question is what is the standard/official suggested way to do it. Can it be done via manually editing files only using the mix command? Perhaps making sure of taking care of the orphans in users_profile when deleting the user?
Does the column have to live on users? It’s a lot easier to enforce constraints like “every profile must have a user” if it’s on profiles instead, and the dependency structure is better (users don’t know about profiles, but profiles know about users)
The whole point of phx.gen.auth and other generators is that they provide a starting point. After running the command, you can and should edit the code to fit your needs. The drawback is that you’ll have to manually backport any modifications to the generators that you’d like to bring to the already generated code - re-running the generators most probably won’t work.
Regarding the design - it depends on your app, I guess. But you can delete profiles which will cascade to users, if that makes sense.