By default sites installed by Aegir have a database name that is 'site_' . $sid;
I want to alter this behaviour to have the databases instead be the site name (=url).
The problem is that Provision does not provide any hooks in this area, that can alter this behaviour.
Now I could just go into _provision_mysql_suggest_db_name() and hack that together, but I wanted to ask, what the right way of doing this is.
IE:
Are there no hooks by choice? Or should I go in and add a hook where I deem it appropriate and provide a patch to provision with that?
Is there any best practice for these kinds of alterations?

Sorry if there is some documentation about this, that I missed. Also if I should have posted this on g.d.o. It just is so code-related that I thought this would be the better place.

Thanks in advance!!!

Comments

Anonymous’s picture

Quick, fleeting response:

There is no documentation or hook providing a way to do this as this is currently an unsupported feature.

Also see #666898: Allow user to specify db name suggestion which this ticket is probably more or less a duplicate of (although its focus was originally on the frontend).

See also the problem you are venturing into with databases being named after the site name, given that MySQL trims characters and you will end up with namespace clashes #545840: running install command from command prompt creates better DB name

tstoeckler’s picture

Status: Active » Closed (duplicate)

Yeah thanks for the links. Marking duplicate on either of those.
That gives me something to think about...

And:
/note to self: Remember to search in closed issues also