Created
August 5, 2014 13:35
-
-
Save angry-dan/38efe9356ce800266c18 to your computer and use it in GitHub Desktop.
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
| <?php | |
| db_query(" | |
| INSERT IGNORE INTO {field_data_FIELD_NAME} (entity_type, bundle, deleted, entity_id, revision_id, language, delta, VALUE_COLUMNS...) | |
| SELECT | |
| 'ENTITY TYPE' AS entity_type, | |
| 'BUNDLE' AS bundle, | |
| 0 AS deleted, | |
| ENTITY ID AS entity_id, | |
| REVISION ID IF EXISTS ELSE ENTITY ID AS revision_id, | |
| 'und' AS language, | |
| 0 AS delta, | |
| 0 AS field_is_featured_value | |
| FROM {ENTITY TABLE} | |
| WHERE BUNDLE = STRING OR THIS FOR TERMS: (select vid from {taxonomy_vocabulary} where machine_name = 'BUNDLE') | |
| "); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment