8 use Phinx\Migration\AbstractMigration;
10 public function up() {
11 $tableName =
"cu_vendorcache";
12 $tableColumn =
"username";
13 if ($this->hasTable($tableName)) {
14 $table = $this->table( $tableName );
15 $hasColumn = $table->hasColumn( $tableColumn );
17 print
"Upgrade {$tableName}.\n";
19 $this->query(
"alter table $tableName alter column $tableColumn type varchar(50)");
22 print
"Skip $tableName, table not found.\n";
26 public function down() {
27 $tableName =
"cu_vendorcache";
28 $tableColumn =
"username";
29 if ($this->hasTable($tableName)) {
30 $table = $this->table( $tableName );
31 $hasColumn = $table->hasColumn( $tableColumn );
33 print
"Downgrade {$tableName}.\n";
35 $this->query(
"alter table $tableName alter column $tableColumn type char(12)");
38 print
"Skip $tableName, table not found.\n";