-
-
Save thelebster/d74cfb4efe7c27143d18f923233776b8 to your computer and use it in GitHub Desktop.
Clean field_collection data, when migrating existing fields
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env drush | |
| $result = db_query("SELECT id, data from field_config where type = 'field_collection'"); | |
| foreach ($result as $field) { | |
| $data = unserialize($field->data); | |
| $data['indexes'] = array('revision_id' => array('revision_id')); | |
| $data = serialize($data); | |
| db_query("update field_config set data = :data where id = :id", array(':data' => $data, ':id'=> $field->id)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment