Created
August 28, 2014 14:17
-
-
Save szeidler/8fefd5f505e9c2e07363 to your computer and use it in GitHub Desktop.
Clean field_collection data, when migrating existing fields
This file contains 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