TikiWashed
Tiki Database Column Name Search and Replace
Created by: Andrew Slater, Last modification: 07 May 2004 (20:47 UTC)
As an experiment related to our recent discussion about database column names I created a simple script which uses a search and replace utility to recursively replace all camelCapped column names so they would appear as: camel_capped. I used this great utility to do the searching/replacing. Here is an excerpt from the script:
Upgrading from Bonnie to ReleaseOne? Check out BonnieToReleaseOne for a script to update your database for use with a ReleaseOne install.
rrpl.sh objId obj_id
rrpl.sh singleItemVotes single_item_votes
rrpl.sh singleChartVotes single_chart_votes
rrpl.sh autoValidate auto_validate
rrpl.sh topN top_n
rrpl.sh maxVoteValue max_vote_value
rrpl.sh showAverage show_average
rrpl.sh isActive is_active
rrpl.sh showVotes show_votes
rrpl.sh useCookies use_cookies
rrpl.sh lastChart last_chart
rrpl.sh voteAgainAfter vote_again_after
rrpl.sh channelId channel_id
and here is rrpl.sh (probably could have just used an alias):
It does a case-sensitive search and replace on all offending column names. Inital results look good. Fresh install went fine and nothing seems to be broken. Some variable names were changed as a side-effect (e.g. anywhere we had a variable named $blogId would now be $blog_id)
You can find the results of these changes here. If possible we should hammer away and make sure nothing was inadvertently broken. I tried to be as accurate as possible when writing the script but there is a chance of a misspelling in one of the 500+ lines. Anyone want to proof-read? (:wink:) SEWilco: fixed spelling in this paragraph (:cool:)
Upgrading from Bonnie to ReleaseOne? Check out BonnieToReleaseOne for a script to update your database for use with a ReleaseOne install.
- tiki_categorized_objects
rrpl.sh objId obj_id
- tiki_category_sites
- tiki_chart_items
- tiki_charts
rrpl.sh singleItemVotes single_item_votes
rrpl.sh singleChartVotes single_chart_votes
rrpl.sh autoValidate auto_validate
rrpl.sh topN top_n
rrpl.sh maxVoteValue max_vote_value
rrpl.sh showAverage show_average
rrpl.sh isActive is_active
rrpl.sh showVotes show_votes
rrpl.sh useCookies use_cookies
rrpl.sh lastChart last_chart
rrpl.sh voteAgainAfter vote_again_after
- tiki_charts_rankings
- tiki_chat_channels
- tiki_chat_messages
rrpl.sh channelId channel_id
and here is rrpl.sh (probably could have just used an alias):
- !/bin/sh
It does a case-sensitive search and replace on all offending column names. Inital results look good. Fresh install went fine and nothing seems to be broken. Some variable names were changed as a side-effect (e.g. anywhere we had a variable named $blogId would now be $blog_id)
You can find the results of these changes here. If possible we should hammer away and make sure nothing was inadvertently broken. I tried to be as accurate as possible when writing the script but there is a chance of a misspelling in one of the 500+ lines. Anyone want to proof-read? (:wink:) SEWilco: fixed spelling in this paragraph (:cool:)