I need to manually update the display settings for my content types. I have a lot of content types and I don't want to have to do it one-by-one using the UI. Where can I show/hide fields for Default and teaser displays for content types directly in the DB?
Backup your database then ...
The tables that you want to deal with are:
- The main field configuration
- The field configuration on a particular entity bundle.
You can use database administration navigate to the table 'field_config' to see that there is a column titled 'deleted' and a value of '0' for active and '1' for deleted fields (they should stay in your database because you've not burrowed down to the field specific tables)
Using Mysql run:
UPDATE field_config SET deleted = 1 where field_name = 'field_my_unwanted_field_1','field_my_unwanted_field_2'; TRUNCATE TABLE cache_field;
In the event that you also need to fiddle the 'field_config_instance' table
UPDATE field_config_instance SET deleted = 1 where field_name = 'field_my_unwanted_field_1','field_my_unwanted_field_2'; TRUNCATE TABLE cache_field;
With basic Drupal, the db table is field_config_instance, all in the "data" column.
With Display suite, you should also look at ds_fields, ds_field_settings, ds_layout_settings.
(Use drush sqlc for a mysql commandline, and then "describe ds_field_settings;" etc.)
This being said, you really want to look for API functions. Look at:
- For display suite I'm not completely sure where you need to look.. But again, submit handlers are usually a good place to look.
A different approach would be to use Features module and export your content types as features, edit the exported file with find/replace or whatever, then import the feature.
Another possibility would be to use https://drupal.org/project/configuration