Firstly, sorry if this is the wrong forum
This may be a stupid question, but would creating a view in the moodle database cause any issues with, say, database checks on an upgrade?
Is it not advisable for any other reason?
If you need context:
I need a view that returns username + a specific custom user field (that the user sets in their profile) in a single table. This won't be used in any way by moodle code but by a third party tool which will have read access to that view only. The tool doesn't let you write joins etc but expects a single table with 2 columns
CREATE VIEW usersAndACustomField
mdl_user.username AS moodleusername,
mdl_user_info_data.data AS profile_field_value
INNER JOIN mdl_user_info_data ON mdl_user.id = mdl_user_info_data.userid
WHERE mdl_user_info_field.id = 3