芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/www/midiatech/db/migrations/20190620142655_add_playlist_enable_stat_migration.php
. */ use Phinx\Migration\AbstractMigration; class AddPlaylistEnableStatMigration extends AbstractMigration { /** @inheritdoc */ public function change() { $playlistTable = $this->table('playlist'); if (!$playlistTable->hasColumn('enableStat')) { $playlistTable ->addColumn('enableStat', 'string', ['null' => true]) ->save(); } $settingsTable = $this->table('setting'); if (!$this->fetchRow('SELECT * FROM `setting` WHERE setting = \'PLAYLIST_STATS_ENABLED_DEFAULT\'')) { $settingsTable ->insert([ [ 'setting' => 'PLAYLIST_STATS_ENABLED_DEFAULT', 'value' => 'Inherit', 'userSee' => 1, 'userChange' => 1 ] ]) ->save(); } } }