Odyssey
2018073100_disclosureTitlesUpd.php
1 <?php
2 /**
3  * Notes:
4  * 1. Anything complicated needs to be done with SQL.
5  * 2. Always have a check to know if the migration needs to occur (up or down).
6  * 3. Use up() and down(), not change(), because of the SQL
7  */
8 use Phinx\Migration\AbstractMigration;
9 
10 class DisclosureTitlesUpd extends AbstractMigration {
11  public function up() {
12  $tableName = "cucmsdocs";
13 
14  if ($this->hasTable($tableName)) {
15  // check for specific docsid 59 ACH Notice
16  $docs = $this->fetchRow("SELECT * FROM cucmsdocs WHERE docsid = 59");
17  if ($docs) {
18  $this->query("UPDATE cucmsdocs SET docstitle='ACH Transfer' WHERE docsid = 59");
19  } else {
20  $this->query("INSERT INTO cucmsdocs VALUES (59, 'achNotice', 'ACH Notice', 2, 'Y', 'Notice', ' ', 'D', 'ACH Transfer', 'Products', 10, NULL, NULL)");
21  }
22 
23  // check for specific docsid 60 ACH Terms of Use
24  $docs = $this->fetchRow("SELECT * FROM cucmsdocs WHERE docsid = 60");
25  if ($docs) {
26  $this->query("UPDATE cucmsdocs SET docstitle='ACH Transfer' WHERE docsid = 60");
27  } else {
28  $this->query("INSERT INTO cucmsdocs VALUES (60, 'achTerms', 'ACH Terms of Use', 1, 'Y', 'Terms of Use', 'Y', 'T', 'ACH Transfer', 'Products', 20, NULL, NULL)");
29  }
30 
31  // check for specific docsid 61 ACH Upload CSV Notice
32  $docs = $this->fetchRow("SELECT * FROM cucmsdocs WHERE docsid = 61");
33  if ($docs) {
34  $this->query("UPDATE cucmsdocs SET docstitle='ACH Transfer', docsdisplaytext='ACH Upload CSV File' WHERE docsid = 61");
35  } else {
36  $this->query("INSERT INTO cucmsdocs VALUES (61, 'achUploadCSV', 'ACH Upload CSV Notice', 2, 'Y', 'Notice', ' ', 'D', 'ACH Upload CSV File', 'Products', 10, NULL, NULL)");
37  }
38 
39  // check for specific docsid 64 Ext Notice
40  $docs = $this->fetchRow("SELECT * FROM cucmsdocs WHERE docsid = 62");
41  if ($docs) {
42  $this->query("UPDATE cucmsdocs SET docstitle='EXT Transfer' WHERE docsid = 62");
43  } else {
44  $this->query("INSERT INTO cucmsdocs VALUES (62, 'extAccountNotice', 'Ext Notice', 2, 'Y', 'Notice', ' ', 'D', 'EXT Transfer', 'Products', 10, NULL, NULL)");
45  }
46 
47  // check for specific docsid 65 Ext Terms of Use
48  $docs = $this->fetchRow("SELECT * FROM cucmsdocs WHERE docsid = 63");
49  if ($docs) {
50  $this->query("UPDATE cucmsdocs SET docstitle='EXT Transfer' WHERE docsid = 63");
51  } else {
52  $this->query("INSERT INTO cucmsdocs VALUES (63, 'extAccountTerms', 'Ext Terms of Use', 1, 'Y', 'Terms of Use', 'Y', 'T', 'EXT Transfer', 'Products', 20, NULL, NULL)");
53  }
54 
55  // check for specific docsid 64 M2M Notice
56  $docs = $this->fetchRow("SELECT * FROM cucmsdocs WHERE docsid = 64");
57  if ($docs) {
58  $this->query("UPDATE cucmsdocs SET docstitle='M2M Transfer' WHERE docsid = 64");
59  } else {
60  $this->query("INSERT INTO cucmsdocs VALUES (64, 'm2mAccountNotice', 'M2M Notice', 2, 'Y', 'Notice', ' ', 'D', 'M2M Transfer', 'Products', 10, NULL, NULL)");
61  }
62 
63  // check for specific docsid 65 M2M Terms of Use
64  $docs = $this->fetchRow("SELECT * FROM cucmsdocs WHERE docsid = 65");
65  if ($docs) {
66  $this->query("UPDATE cucmsdocs SET docstitle='M2M Transfer' WHERE docsid = 65");
67  } else {
68  $this->query("INSERT INTO cucmsdocs VALUES (65, 'm2mAccountTerms', 'M2M Terms of Use', 1, 'Y', 'Terms of Use', 'Y', 'T', 'M2M Transfer', 'Products', 20, NULL, NULL)");
69  }
70 
71  // check for specific docsid 36 CheckFree Bill Pay SSO Terms of Use
72  $docs = $this->fetchRow("SELECT * FROM cucmsdocs WHERE docsid = 36");
73  if ($docs) {
74  $this->query("UPDATE cucmsdocs SET docstitle='Bill Pay' WHERE docsid = 36");
75  } else {
76  $this->query("INSERT INTO cucmsdocs VALUES (36, 'ChkFreeSSO_TOS', 'CheckFree Bill Pay SSO Terms of Service', 1, 'Y', 'Terms of Use', 'Y', 'T', 'Bill Pay', '3rd Party', 30, NULL, NULL)");
77  }
78  }
79  }
80 
81  public function down() {
82 
83  }
84 }