2 declare(strict_types=1);
4 use Phinx\Migration\AbstractMigration;
5 use Phinx\Db\Adapter\MysqlAdapter;
12 $table = $this->table(
'river');
13 if (
$table->hasColumn(
'last_action')) {
17 $table->addColumn(
'last_action',
'integer', [
19 'limit' => MysqlAdapter::INT_REGULAR,
22 $table->addIndex([
'last_action'], [
23 'name' =>
'last_action',
30 $prefix = $this->getAdapter()->getOption(
'table_prefix');
32 $this->execute(
"UPDATE {$prefix}river SET last_action = posted");
change()
Adds the river last action column and fills it with the posted timestamp.