Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Today when I was testing the new HEAD release, I of course wanted to throw as many silly things at it as possible, so I went to add a table prefix. Then I caught myself because I couldn't remember if the prefix should be "head_" or "head" ... patch upcoming.
Comment | File | Size | Author |
---|---|---|---|
#3 | drupal-table-prefix-example-172396-3.patch | 1.18 KB | webchick |
#1 | drupal-table-prefix-example-172396-1.patch | 922 bytes | webchick |
Comments
Comment #1
webchickHere we go.
Btw, I went with "cms_" rather than "drupal_" because we don't have "Drupal" mentioned anywhere in this text, by design.
Comment #2
ChrisKennedy CreditAttribution: ChrisKennedy commentedTwo quick thoughts: 1) some people don't know what "cms" stands for or means 2) the rest of the string suggests that the prefix should differ by site. So I think a slightly better example would be "site_" or "domain_".
Comment #3
webchickGood points. cms_ is definitely a bad choice.
However, you've highlighted another bug with this string... the prefixing is not so much about how many websites are sharing a database, but how many *applications* are sharing a database (or, I guess "application instances," but that's a bit technical). I could have PHPBB and Drupal on the same website, and they are going to get very cranky if they're both looking for a 'users' table. So I've fixed that too.
"drupal_" is actually the string this ought to be, but can't because of the install profile problem. So here's a new patch that sets this based on the profile internal name, which will always be lower-case w/ underscores. I make an exception for 'default' because 'default_' doesn't make a lot of sense as a prefix, but 'civicspace_' and 'drupaled_' would.
Comment #4
webchickOops. Didn't mean to change status.
Comment #5
catchStill applies with offset. Changes look sensible to me.
Comment #6
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #7
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.