Hi
the easiest way with backing up values into php variable is something like that:
//backup data
$vals = Utils_RecordBrowserCommon::get_records('some_table',array(),array('some_col','id'),array(),array(),true);
//delete old column def
Utils_RecordBrowserCommon::delete_record_field('some_table','some_col');
//create new column def with the same name
Utils_RecordBrowserCommon::new_record_field('some_table',array('name'=>'some_col', ...........));
//restore data
foreach($vals as $v) {
Utils_RecordBrowserCommon::update_record('some_table',$v['id'],array('some_col'=>$v['some_col']));
}
Of course there can be some data conversion ($v['some_col']) before update_record... for example if it was select and you are moving data into multiselect you should place ID in array, something like:
Utils_RecordBrowserCommon::update_record('some_table',$v['id'],array('some_col'=>array($v['some_col'])));
Best regards
Paul