![]() Generally, if you are using anything like phpMyAdmin, it is probably a good idea to run a search on the whole database looking for the old field name to make sure you have not missed anything. Note that old field name could appear there several times, and also that data in this column is serialized - so if your new field name length is different from the old length, you need to update counter respectively too. In case of views for example, if you still want to update old field names directly in database (which actually could be faster than doing it from administration area, though not necessarily safer - you need to feel really confident about fiddling with database content directly), you need to update value of display_options column in views_display table. This is a patch (bugfix) release of Drupal 10 and is ready for use on production sites. Remember to clear the caches after all your changes!Īlso, if you have any views using any of the old fields, or any other place where the old field name could exist, you need to update them too. (and yes, you have to include column specification and constraints here, otherwise it will not work)ĭo the same with field_revision_field_tags table: RENAME TABLE `field_revision_field_tags` TO `field_revision_field_tag` ĪLTER TABLE `field_revision_field_tag` CHANGE `field_tags_tid` `field_tag_tid` INT(10) UNSIGNED NULL DEFAULT NULL ![]() In table field_data_field_tag - rename column name field_tags_tid to field_tag_tid: ALTER TABLE `field_data_field_tag` CHANGE `field_tags_tid` `field_tag_tid` INT(10) UNSIGNED NULL DEFAULT NULL (pay attention to back quotes, they are important here) Rename table field_data_field_tags to field_data_field_tag: RENAME TABLE `field_data_field_tags` TO `field_data_field_tag` In table field_config - update old field name to a new one in field_name column: UPDATE field_config SET field_name = 'field_tag' WHERE field_name = 'field_tags' ĭo the same in table field_config_instance: UPDATE field_config_instance SET field_name = 'field_tag' WHERE field_name = 'field_tags' Let's assume you want to change Drupal 7's default field field_tags and rename it to singular field_tag. Remember however to always dump a backup copy of your database just in case things go wrong, and be really careful when executing those changes! No worries though, this still could be done quite easily by only few updates directly to the database. Once a new content field is created, there is no way to change its machine name from administration area.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |