Subversion Repositories oidplus

Rev

Rev 296 | Rev 386 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. /*
  4.  * OIDplus 2.0
  5.  * Copyright 2020 Daniel Marschall, ViaThinkSoft
  6.  *
  7.  * Licensed under the Apache License, Version 2.0 (the "License");
  8.  * you may not use this file except in compliance with the License.
  9.  * You may obtain a copy of the License at
  10.  *
  11.  *     http://www.apache.org/licenses/LICENSE-2.0
  12.  *
  13.  * Unless required by applicable law or agreed to in writing, software
  14.  * distributed under the License is distributed on an "AS IS" BASIS,
  15.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16.  * See the License for the specific language governing permissions and
  17.  * limitations under the License.
  18.  */
  19.  
  20. // DATABASE UPDATE 203 -> 204
  21. // This script will be included by OIDplusDatabaseConnection.class.php inside function afterConnect().
  22. // Parameters: $this is the OIDplusDatabaseConnection class
  23. //             $version is the current version (this script MUST increase the number by 1 when it is done)
  24.  
  25. if (!isset($version)) throw new OIDplusException(_L('Argument "%1" is missing; was the file included in a wrong way?','version'));
  26. if (!isset($this))    throw new OIDplusException(_L('Argument "%1" is missing; was the file included in a wrong way?','this'));
  27.  
  28. if ($this->transaction_supported()) $this->transaction_begin();
  29.  
  30. if ($this->getSlang()::id() == 'mssql') {
  31.         $this->query("ALTER TABLE ###log_object ADD severity [int]");
  32.         $this->query("ALTER TABLE ###log_user ADD severity [int]");
  33. }
  34. else if ($this->getSlang()::id() == 'mysql') {
  35.         $this->query("ALTER TABLE ###log_object ADD severity int(11)");
  36.         $this->query("ALTER TABLE ###log_user ADD severity int(11)");
  37. }
  38. else if ($this->getSlang()::id() == 'pgsql') {
  39.         $this->query("ALTER TABLE ###log_object ADD severity integer");
  40.         $this->query("ALTER TABLE ###log_user ADD severity integer");
  41. }
  42. else if ($this->getSlang()::id() == 'sqlite') {
  43.         $this->query("ALTER TABLE ###log_object ADD severity integer");
  44.         $this->query("ALTER TABLE ###log_user ADD severity integer");
  45. }
  46.  
  47. $version = 204;
  48. $this->query("UPDATE ###config SET value = ? WHERE name = 'database_version'", array($version));
  49.  
  50. if ($this->transaction_supported()) $this->transaction_commit();