9 use Phinx\Migration\AbstractMigration;
13 public function up() {
15 $hcuFwdList = [
'Type' =>
'string',
'Default' =>
'',
'Message' =>
'-1 to forward all OR csv list of member numbers to forward OR 0-empty-undefined no forwarding'];
16 $hcuFwdToVen = [
'Type' =>
'string',
'Default' =>
'',
'Message' =>
'trustedID of forward-to vendor. Case and spelling matter'];
18 $tableName =
"cutrustedmaster";
19 $exists = $this->hasTable($tableName);
22 $sql =
"select trustedid, trustedfields from ${tableName} where trustedid like 'RDC%'";
23 $trustedMasterList = $this->fetchAll($sql);
25 for ($i = 0; $i < count($trustedMasterList); $i++) {
27 $trustedid = trim($trustedMasterList[$i][
"trustedid"]);
28 $trustedfields = trim($trustedMasterList[$i][
"trustedfields"]);
29 $trustedarr = json_decode($trustedfields,
true);
30 $trustedarr[
'hcuFwdToVen'] = $hcuFwdToVen;
31 $trustedarr[
'hcuFwdList'] = $hcuFwdList;
32 $unpreppedDetailString = json_encode($trustedarr);
33 $detailsString = pg_escape_string($unpreppedDetailString);
35 $sql =
"update ${tableName} set trustedfields = '${detailsString}' where trustedid='${trustedid}'";
45 public function down() {