8 use Phinx\Migration\AbstractMigration;
11 public function up() {
12 $tableName =
"cutronah";
13 $tableColumn =
"checknumber";
15 if ($this->hasTable($tableName)) {
16 $table = $this->table( $tableName );
18 $hasColumn = $table->hasColumn( $tableColumn );
21 print
"Upgrade {$tableName}.\n";
24 $this->query(
"alter table $tableName alter column $tableColumn type char(9)");
27 print
"Skip $tableName, table not found.\n";
31 public function down() {
32 $tableName =
"cutronah";
33 $tableColumn =
"checknumber";
35 if ($this->hasTable($tableName)) {
36 $table = $this->table( $tableName );
38 $hasColumn = $table->hasColumn( $tableColumn );
41 print
"Not downgrading {$tableName}.\n";
47 print
"Skip $tableName, table not found.\n";