plugin to alter table change column name and update schema

By daniel - September 6, 2021

Hi Jeff,

It's possible to make modifications to schemas using the loadSchema() and saveSchema() functions. Specifically, if you want to rename a field, you could do something like this:

  $schema = loadSchema('table_name');
  $schema['field_key']['label'] = 'New Label';
  saveSchema('table_name', $schema);

You'd just need to substitute your own table/field values.

Let me know if you have any questions!

Thanks,

Daniel
Technical Lead
interactivetools.com