File modules/cms/update/version/DBVersion000027.class.php

Last commit: Sun Oct 1 02:58:08 2023 +0200	Jan Dankert	Refactoring: No it is possible to use 8 byte integers in the database
1 <?php 2 3 namespace cms\update\version; 4 5 use database\DbVersion; 6 use database\Column; 7 use security\Password; 8 9 /** 10 * The type of a permission is stored in a new column. 11 * 12 * @author dankert 13 * 14 */ 15 class DBVersion000027 extends DbVersion 16 { 17 /** 18 * 19 */ 20 public function update() 21 { 22 $table = $this->table('acl'); 23 $table->column('type' )->type(Column::TYPE_INT)->size(Column::SIZE_INT_MED)->defaultValue(3)->add(); 24 25 // Initial Value: Copy from element. 26 $tableSqlName = $table->getSqlName(); 27 28 $updateStmt = $this->getDb()->sql(<<<SQL 29 UPDATE $tableSqlName 30 SET type=3; 31 SQL 32 ); 33 $updateStmt->execute(); 34 35 $updateStmt = $this->getDb()->sql(<<<SQL 36 UPDATE $tableSqlName 37 SET type=2 where groupid is not null; 38 SQL 39 ); 40 $updateStmt->execute(); 41 42 $updateStmt = $this->getDb()->sql(<<<SQL 43 UPDATE $tableSqlName 44 SET type=1 where userid is not null; 45 SQL 46 ); 47 $updateStmt->execute(); 48 } 49 } 50
Download modules/cms/update/version/DBVersion000027.class.php
History Sun, 1 Oct 2023 02:58:08 +0200 Jan Dankert Refactoring: No it is possible to use 8 byte integers in the database Sun, 7 Mar 2021 00:10:20 +0100 Jan Dankert Refactoring: Hopefully more performance while accessing the database resultsets. Sat, 6 Mar 2021 02:09:25 +0100 Jan Dankert New: Allow permissions for guests only.