芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/avenida/views/migrations.zip
PK jqY5=na a 4 20180131122645_one_region_per_playlist_migration.phpnu [ table('playlist'); $playlist ->addColumn('regionId', 'integer', ['null' => true]) ->addColumn('createdDt', 'datetime') ->addColumn('modifiedDt', 'datetime') ->addColumn('duration', 'integer', ['default' => 0]) ->addColumn('requiresDurationUpdate', 'integer', ['default' => 0, 'limit' => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY]) ->save(); $this->execute('UPDATE `playlist` SET regionId = (SELECT MAX(regionId) FROM lkregionplaylist WHERE playlist.playlistId = lkregionplaylist.playlistId);'); $this->dropTable('lkregionplaylist'); $this->execute('UPDATE `pages` SET asHome = 1 WHERE name = \'playlist\';'); $this->execute(' INSERT INTO module (Module, Name, Enabled, RegionSpecific, Description, ImageUri, SchemaVersion, ValidExtensions, PreviewEnabled, assignable, render_as, settings, viewPath, class, defaultDuration) VALUES (\'subplaylist\', \'Sub-Playlist\', 1, 1, \'Embed a Sub-Playlist\', \'forms/library.gif\', 1, null, 1, 1, \'native\', null, \'../modules\', \'Xibo\\\\Widget\\\\SubPlaylist\', 10); '); $playlistClosure = $this->table('lkplaylistplaylist', ['id' => false, 'primary_key' => ['parentId', 'childId', 'depth']]); $playlistClosure ->addColumn('parentId', 'integer') ->addColumn('childId', 'integer') ->addColumn('depth', 'integer') ->addIndex(['childId', 'parentId', 'depth'], ['unique' => true]) ->save(); $this->execute('INSERT INTO lkplaylistplaylist (parentId, childId, depth) SELECT playlistId, playlistId, 0 FROM playlist;'); } } PK jqY߿ 1 20200130165443_countdown_module_add_migration.phpnu [ . */ use Phinx\Migration\AbstractMigration; /** * Class CountdownModuleAddMigration */ class CountdownModuleAddMigration extends AbstractMigration { /** @inheritDoc */ public function change() { if (!$this->fetchRow('SELECT * FROM module WHERE module = \'countdown\'')) { $modules = $this->table('module'); $modules->insert([ 'module' => 'countdown', 'name' => 'Countdown', 'enabled' => 1, 'regionSpecific' => 1, 'description' => 'Countdown Module', 'schemaVersion' => 1, 'previewEnabled' => 1, 'assignable' => 1, 'render_as' => 'html', 'viewPath' => '../modules', 'class' => 'Xibo\Widget\Countdown', 'defaultDuration' => 60, 'installName' => 'countdown' ])->save(); } } } PK jqY?B- - ( 20181126113231_release1812_migration.phpnu [ . */ use Phinx\Migration\AbstractMigration; /** * Class Release1812Migration * applicable changes from 143.json */ class Release1812Migration extends AbstractMigration { /** @inheritdoc */ public function change() { // Add a setting allowing users to auto authorise new displays if (!$this->fetchRow('SELECT * FROM `setting` WHERE setting = \'DISPLAY_AUTO_AUTH\'')) { $this->table('setting')->insert([ [ 'setting' => 'DISPLAY_AUTO_AUTH', 'value' => 0, 'userSee' => 0, 'userChange' => 0 ] ])->save(); } // Rename Dashboard to Icon Dashboard $this->execute('UPDATE `pages` set title = \'Icon Dashboard\', name = \'icondashboard\' WHERE `name` = \'dashboard\''); // Change the DataSet View module name $this->execute('UPDATE `module` set Name = \'DataSet View\' WHERE `Module` = \'datasetview\''); // Add M4V extension to Video module if (!$this->fetchRow('SELECT * FROM `module` WHERE `module` = \'video\' AND validExtensions LIKE \'%m4v%\'')) { $this->execute('UPDATE `module` SET validExtensions = CONCAT(validextensions, \',m4v\') WHERE `module` = \'video\' LIMIT 1;'); } } } PK jqYYM& & 0 20180131114058_old_upgrade_step129_migration.phpnu [ hasTable('version')) { // We do have a version table, so we're an upgrade from anything 1.7.0 onward. $row = $this->fetchRow('SELECT * FROM `version`'); $dbVersion = $row['DBVersion']; // Are we on the relevent step for this upgrade? if ($dbVersion < $STEP) { // Perform the upgrade $requiredFile = $this->table('requiredfile', ['id' => 'rfId']); $requiredFile ->addColumn('displayId', 'integer') ->addColumn('type', 'string', ['limit' => 1]) ->addColumn('class', 'string', ['limit' => 1]) ->addColumn('itemId', 'integer', ['null' => true]) ->addColumn('bytesRequested', 'integer', ['limit' => \Phinx\Db\Adapter\MysqlAdapter::INT_BIG]) ->addColumn('complete', 'integer', ['limit' => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY, 'default' => 0]) ->addColumn('path', 'string', ['null' => true, 'limit' => 255]) ->addColumn('size', 'integer', ['limit' => \Phinx\Db\Adapter\MysqlAdapter::INT_BIG, 'default' => 0]) ->addIndex(['displayId', 'type']) ->save(); $resolution = $this->table('resolution'); $resolution ->addColumn('userId', 'integer') ->save(); $this->execute('UPDATE `resolution` SET userId = 0;'); $this->execute('UPDATE `setting` SET `options` = \'private|group|group write|public|public write\' WHERE setting IN (\'MEDIA_DEFAULT\', \'LAYOUT_DEFAULT\');'); $linkCampaignTag = $this->table('lktagcampaign', ['id' => 'lkTagCampaignId']); $linkCampaignTag ->addColumn('tagId', 'integer') ->addColumn('campaignId', 'integer') ->addIndex(['tagId', 'campaignId'], ['unique' => true]) ->save(); $display = $this->table('display'); $display ->addColumn('timeZone', 'string', ['limit' => 254, 'null' => true]) ->save(); // Bump our version $this->execute('UPDATE `version` SET DBVersion = ' . $STEP); } } } } PK jqY7# 2 20180327153325_remove_user_logged_in_migration.phpnu [ . */ use Phinx\Migration\AbstractMigration; /** * Class RemoveUserLoggedInMigration * Removes the logged in column if it still exists. */ class RemoveUserLoggedInMigration extends AbstractMigration { /** @inheritdoc */ public function change() { $table = $this->table('user'); if ($table->hasColumn('loggedIn')) { $table->removeColumn('loggedIn')->update(); } } } PK jqY,Zc = 20180906115712_add_foreign_keys_to_widget_media_migration.phpnu [ . */ use Phinx\Migration\AbstractMigration; /** * Class AddForeignKeysToWidgetMediaMigration */ class AddForeignKeysToWidgetMediaMigration extends AbstractMigration { /** @inheritdoc */ public function change() { if (!$this->fetchRow(' SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE constraint_schema=DATABASE() AND `table_name` = \'lkwidgetmedia\' AND referenced_table_name = \'media\';')) { $this->execute('DELETE FROM `lkwidgetmedia` WHERE NOT EXISTS (SELECT mediaId FROM `media` WHERE `media`.mediaId = `lkwidgetmedia`.mediaId) '); // Add the constraint $this->execute('ALTER TABLE `lkwidgetmedia` ADD CONSTRAINT `lkwidgetmedia_ibfk_1` FOREIGN KEY (`mediaId`) REFERENCES `media` (`mediaId`);'); } if (!$this->fetchRow(' SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE constraint_schema=DATABASE() AND `table_name` = \'lkwidgetmedia\' AND referenced_table_name = \'widget\';')) { $this->execute('DELETE FROM `lkwidgetmedia` WHERE NOT EXISTS (SELECT widgetId FROM `widget` WHERE `widget`.widgetId = `lkwidgetmedia`.widgetId) '); // Add the constraint $this->execute('ALTER TABLE `lkwidgetmedia` ADD CONSTRAINT `lkwidgetmedia_ibfk_2` FOREIGN KEY (`widgetId`) REFERENCES `widget` (`widgetId`);'); } } } PK jqYN 7 20191126141140_remote_data_set_csv_source_migration.phpnu [ 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']); } } } PK jqY 8 20180313085749_media_table_edited_id_index_migration.phpnu [ . */ use Phinx\Migration\AbstractMigration; /** * Class MediaTableEditedIdIndexMigration * Add EditedMediaId index to the Media table */ class MediaTableEditedIdIndexMigration extends AbstractMigration { /** * @inheritdoc */ public function change() { $table = $this->table('media'); $table ->addIndex('editedMediaId') ->update(); } } PK jqY&OZ