Odyssey
2019022000_altercutronab.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 Altercutronab extends AbstractMigration {
11  public function up() {
12 
13  // ** Change the description column for cutronab
14  // allow null characters in the description column of cutronab
15  // which should not have an impact on the running scheduled transfers.
16 
17  $tableName = 'cutronab';
18  $tableCol = 'description';
19 
20  // check if table exists - cu_scheduledtxn
21  if ($this->hasTable($tableName)) {
22 
23  $table = $this->table($tableName);
24  if ($table->hasColumn($tableCol)) {
25 
26  // ** Modify column to allow nulls
27  $table->changeColumn($tableCol, 'string', ['null' => true, 'limit' => 255])
28  ->save();
29 
30  }
31  }
32 
33  }
34 
35  public function down() {
36  }
37 }