openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

DBVersion000010.class.php (1002B)


      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 }