By GreenLED on
Just what the title says. How can you rename a cck field? I want to rename the actual field name -- not the label. Is it possible to just do this via the mysql tables? This would obviously be ok if it would only have one reference, but have some bad implications if it was listed in multiple tables. What's the solution here?
Comments
...
Note that renaming a field may cause some problems if some other module expects this field. For example, if you used that field in a view (I'm talking about the Views module), then you'll have to update that view manually, because the old field's name was part of the definition of that view.
Instead of taking chances, "did we update all references?", there's a relatively easy solution:
Create the new field, then copy, using SQL, the old field's data into the new one. (And you'll have to clear Drpual's cache, because CCK caches the nodes it loads.)
The SQL to use depends on whether the field is stored in its own table ("SELECT ... INTO ...") or in the content-type's main table ("UPDATE ...").
Hmmm, Interesting. I will
Hmmm, Interesting. I will have to try that later on. I don't want to "take any chances" as you say. Plus, I'm past development (when is anyone?!) and have the production site working. The thoughts are ideas are MUCH appreciated. This will be tackled some time. I really needed to know though -- thanks!
» Respectfully, GreenLED
»
CCK Field Rename
http://drupal.org/project/cck_field_rename
User cck_field_rename
If you want to rename the cck fields then use the cck_fields_rename module for drupal 6.