Rev 1219 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1219 | Rev 1231 | ||
---|---|---|---|
Line 25... | Line 25... | ||
25 | * @return int new version set |
25 | * @return int new version set |
26 | * @throws \ViaThinkSoft\OIDplus\OIDplusException |
26 | * @throws \ViaThinkSoft\OIDplus\OIDplusException |
27 | */ |
27 | */ |
28 | function oidplus_dbupdate_203(OIDplusDatabaseConnection $db): int { |
28 | function oidplus_dbupdate_203(OIDplusDatabaseConnection $db): int { |
29 | if ($db->transaction_supported()) $db->transaction_begin(); |
29 | if ($db->transaction_supported()) $db->transaction_begin(); |
30 | 30 | try { |
|
31 | if ($db->getSlang()->id() == 'mssql') { |
31 | if ($db->getSlang()->id() == 'mssql') { |
32 | $db->query("ALTER TABLE ###log_object ADD severity [int]"); |
32 | $db->query("ALTER TABLE ###log_object ADD severity [int]"); |
33 | $db->query("ALTER TABLE ###log_user ADD severity [int]"); |
33 | $db->query("ALTER TABLE ###log_user ADD severity [int]"); |
34 | } |
34 | } |
35 | else if ($db->getSlang()->id() == 'mysql') { |
35 | else if ($db->getSlang()->id() == 'mysql') { |
Line 47... | Line 47... | ||
47 | 47 | ||
48 | $version = 204; |
48 | $version = 204; |
49 | $db->query("UPDATE ###config SET value = ? WHERE name = 'database_version'", array("$version")); |
49 | $db->query("UPDATE ###config SET value = ? WHERE name = 'database_version'", array("$version")); |
50 | 50 | ||
51 | if ($db->transaction_supported()) $db->transaction_commit(); |
51 | if ($db->transaction_supported()) $db->transaction_commit(); |
- | 52 | } catch (\Exception $e) { |
|
- | 53 | if ($db->transaction_supported()) $db->transaction_rollback(); |
|
- | 54 | throw new $e; |
|
- | 55 | } |
|
52 | 56 | ||
53 | return $version; |
57 | return $version; |
54 | } |
58 | } |