芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/db/migrations/20191126141140_remote_data_set_csv_source_migration.php
table('dataset'); // Add new columns to dataSet table - ignoreFirstRow and sourceId if (!$dataSetTable->hasColumn('sourceId')) { $dataSetTable ->addColumn('ignoreFirstRow', 'integer', ['limit' => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY, 'default' => null, 'null' => true]) ->addColumn('sourceId', 'integer', ['limit' => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY, 'default' => null, 'null' => true]) ->save(); } // get all existing remote dataSets $getRemoteDataSetsQuery = $this->query('SELECT dataSetId, dataSet FROM dataset WHERE isRemote = 1'); $getRemoteDataSetsResults = $getRemoteDataSetsQuery->fetchAll(PDO::FETCH_ASSOC); // set the sourceId to 1 (json) on all existing remote dataSets foreach ($getRemoteDataSetsResults as $dataSetsResult) { $this->execute('UPDATE dataset SET sourceId = 1 WHERE dataSetId = ' . $dataSetsResult['dataSetId']); } } }