芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/db/migrations/20190214102516_add_media_enable_stat.php
. */ use Phinx\Migration\AbstractMigration; /** * Class AddMediaEnableStat */ class AddMediaEnableStat extends AbstractMigration { /** @inheritdoc */ public function change() { $this->execute('UPDATE `media` SET createdDt = \'1970-01-01 00:00:00\' WHERE createdDt < \'2000-01-01\''); $this->execute('UPDATE `media` SET modifiedDt = \'1970-01-01 00:00:00\' WHERE modifiedDt < \'2000-01-01\''); $table = $this->table('media'); $table ->changeColumn('createdDt', 'datetime', ['null' => true, 'default' => null]) ->changeColumn('modifiedDt', 'datetime', ['null' => true, 'default' => null]) ->addColumn('enableStat', 'string', ['null' => true]) ->save(); } }