I would like the ability to offer a suggestion for the database name that then gets passed to the provision module for new site creation. My idea is that there would be another field on the the new site page where one could enter the desired database name. This would be passed to provision, which would use it to create the new database. Provision would do something similar to what it does now, to make sure that there are no duplicates and appending a number to the end of the suggested name until a unique name is achieved.
Thanks,
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | provision-dbname_a8.patch | 1.25 KB | mcdruid |
| #7 | provision-dbname.patch | 1.19 KB | aaronbauman |
Comments
Comment #1
Anonymous (not verified) commentedSee #545840: running install command from command prompt creates better DB name
It may be that we add an optional field, however we run into risks with MySQL stripping characters from database names that may cause namespace collisions with other databases.
Comment #2
meecect commentedwhat if we include a filed with instructions, similar to many system fields, that has instructions for creating 'machine readable names', and only allow lowercase (or maybe mixed case) characters and numbers and maybe underscores and dashes. Then make that field validate with those characters?
Would you accept a patch that implemented that feature?
Comment #3
anarcat commentedI would personnally think having a patch that would:
1. produce the database name based on the site name
2. produce always unique names
3. avoid collisions with existing sites (ie. support cloning and migration properly)
4. support a prefix (ie. we're using "site_" now)
... would have a good chance of getting in.
Comment #4
Anonymous (not verified) commentedThis is technically a duplicate of this ancient ticket #448960: allow customizing the "database prefix"
But I'll close the other one as the conversation has been happening here since.
Comment #5
azuledu commentedAny progress about this?
I think it would be really useful.
Thanks
Comment #6
adrian commentedIn aegir head we _only_ use the site's URI to generate the db name now.
since we had to stop using site nid's everywhere, and situations like site cloning made the naming scheme unreliable.
Comment #7
aaronbaumanHere's a patch against alpha3, backported from HEAD (as mentioned in #6), that names the database based on the site's URL.
FWIW, if you throw a "db_name" option to drush, you can specify any db name you like.
I would think that modifying the node form would be left to contrib, so as not to add clutter.
Comment #8
mcdruid commentedsame patch as #7 re-rolled for 0.4-alpha8
Comment #9
SeanBannister commentedsub
Comment #10
realityloop commentedWith the new naming structure that came as part of Aegir 0.4 alpha 9, this seems totally unnecessary as you can now easily tell by looking at the DB name which site it belongs to.
Comment #11
aaronbaumanI, too, am satisfied with the solution in 0.4 alpha 9.
Comment #12
adrian commentedIm going to mark this as fixed, because i think we've solved the main issue (ie: noone liking site_X format)