Github Question

We have a customized version of SuiteCRM under a private repo at Github. Our workflow is we make a change locally, check it in and push to Github. After that we pull from our server to get the latest changes. This works fine as long as the change was not adding a custom field to a module.

When we add a custom field and push and pull the files that were changed, the new field is not showing up in studio. This is because of the “field_meta_data” table missing a record for the new custom field.

How do other users get around this when using version control systems?

You can add fields via the vardefs, and after doing a repair and rebuild an sql query should appear so that you can add them to the database. Be aware when creating an entry via the vardefs into the cstm table that you will need at least one entry from that table in the fields_meta_data table. The source part of the field specifies whether it goes in the cstm table or gets added to the original. It is reccomended that you use the cstm table.
An example (placed in custom/Extension/modules/MODULENAME/Ext/Vardefs/anyfilename.php and requires repair and rebuild):

$dictionary['MODULE']['fields']['name_of_field'] = array(
                        'required' => false,
                    'name' => 'name_of_field',
                    'vname' => 'LBL_LABEL',
                    'type' => 'text',
                    'massupdate' => 0,
                    'no_default' => false,
                    'comments' => '',
                    'help' => '',
                    'importable' => 'true',
                    'duplicate_merge' => 'disabled',
                    'duplicate_merge_dom_value' => '0',
                    'audited' => false,
                    'inline_edit' => true,
                    'reportable' => true,
                    'unified_search' => false,
                    'merge_filter' => 'disabled',
                    'len' => '255',
                    'size' => '20',
'source' => 'custom_fields'
);

Thanks. This looks like it will work.