File modules/cms/update/version/DBVersion000010.class.php
Last commit: Sun Mar 7 00:10:20 2021 +0100 Jan Dankert Refactoring: Hopefully more performance while accessing the database resultsets.
1 <?php 2 3 namespace cms\update\version; 4 5 use database\DbVersion; 6 use security\Password; 7 8 /** 9 * Filetype 'file' is now devided into 'file' (unchanged), 'image' (new) and Column::TYPE_TEXT (new). 10 * 11 * @author dankert 12 * 13 */ 14 class DBVersion000010 extends DbVersion 15 { 16 /** 17 * 18 */ 19 public function update() 20 { 21 $db = $this->getDb(); 22 $tableObject = $this->table('object')->getSqlName(); 23 $tableFile = $this->table('file' )->getSqlName(); 24 25 $updateStmt = $db->sql('UPDATE '.$tableObject. 26 ' SET typeid=6 WHERE id IN (SELECT objectid FROM '.$tableFile. 27 " WHERE extension IN ('gif','png','jpeg','jpg','svg','tiff') )" 28 ); 29 $updateStmt->execute(); 30 31 $updateStmt = $db->sql('UPDATE '.$tableObject. 32 ' SET typeid=7 WHERE id IN (SELECT objectid FROM '.$tableFile. 33 " WHERE extension IN ('css','text','txt','js','html','xml','log','ini','gpx') )" 34 ); 35 $updateStmt->execute(); 36 37 } 38 }
Downloadmodules/cms/update/version/DBVersion000010.class.php
History Sun, 7 Mar 2021 00:10:20 +0100 Jan Dankert Refactoring: Hopefully more performance while accessing the database resultsets. Fri, 25 Sep 2020 01:00:58 +0200 Jan Dankert Refactoring: More OO in the database updater :) Sun, 23 Feb 2020 00:30:10 +0100 Jan Dankert Refactoring: Namespacing for module 'database-update', now called 'cms\update'.