16 use Phinx\Migration\AbstractMigration;
23 public function up() {
25 $cuList = $this->fetchAll(
'SELECT cu FROM cuadmin');
27 for ( $i = 0; $i < count( $cuList ); $i++ ) {
28 $cu = strtolower( trim( $cuList[$i][
"cu"] ) );
31 $tableName =
"{$cu}memberacct";
32 $table = $this->table( $tableName );
33 $hasColumn = $table->hasColumn(
'balance_stamp');
38 print
"Migration - Upgrade $cu {$tableName}\n";
44 $table->addColumn(
'balance_stamp',
'biginteger', array(
'null' =>
true))
48 $table->addColumn(
'balance_attempt',
'biginteger', array(
'null' =>
true))
60 public function down() {
62 $cuList = $this->fetchAll(
'SELECT cu FROM cuadmin');
64 for ( $i = 0; $i < count( $cuList ); $i++ ) {
65 $cu = strtolower( trim( $cuList[$i][
"cu"] ) );
68 $tableName =
"{$cu}memberacct";
69 $table = $this->table( $tableName );
70 $hasColumn = $table->hasColumn(
'balance_stamp');
75 print
"Migration - Downgrade $cu {$tableName}\n";
81 $table->removeColumn(
'balance_stamp')
85 $table->removeColumn(
'balance_attempt')