芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/uol/db/migrations/20190626110359_create_stat_table_migration.php
. */ use Phinx\Migration\AbstractMigration; /** * Class CreateStatTableMigration */ class CreateStatTableMigration extends AbstractMigration { /** @inheritdoc */ public function change() { // If stat table exists then rename it if($this->hasTable('stat')) { $statTable = $this->table('stat'); $statTable->rename('stat_archive'); } // Create stat table $table = $this->table('stat', ['id' => 'statId']); $table ->addColumn('type', 'string', ['limit' => 20]) ->addColumn('statDate', 'integer') ->addColumn('scheduleId', 'integer') ->addColumn('displayId', 'integer') ->addColumn('campaignId', 'integer', ['default' => null, 'null' => true]) ->addColumn('layoutId', 'integer', ['default' => null, 'null' => true]) ->addColumn('mediaId', 'integer', ['default' => null, 'null' => true]) ->addColumn('widgetId', 'integer', ['default' => null, 'null' => true]) ->addColumn('start', 'integer') ->addColumn('end', 'integer') ->addColumn('tag', 'string', ['limit' => 254, 'default' => null, 'null' => true]) ->addColumn('duration', 'integer') ->addColumn('count', 'integer') ->addIndex('statDate') ->addIndex(['displayId', 'end', 'type']) ->save(); } }