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_200(OIDplusDatabaseConnection $db): int { |
28 | function oidplus_dbupdate_200(OIDplusDatabaseConnection $db): int { |
29 | if ($db->transaction_supported()) $db->transaction_begin(); |
29 | if ($db->transaction_supported()) $db->transaction_begin(); |
30 | 30 | try { |
|
31 | $db->query("ALTER TABLE ###objects ADD comment varchar(255) NULL"); |
31 | $db->query("ALTER TABLE ###objects ADD comment varchar(255) NULL"); |
32 | 32 | ||
33 | $version = 201; |
33 | $version = 201; |
34 | $db->query("UPDATE ###config SET value = ? WHERE name = 'database_version'", array("$version")); |
34 | $db->query("UPDATE ###config SET value = ? WHERE name = 'database_version'", array("$version")); |
35 | 35 | ||
36 | if ($db->transaction_supported()) $db->transaction_commit(); |
36 | if ($db->transaction_supported()) $db->transaction_commit(); |
- | 37 | } catch (\Exception $e) { |
|
- | 38 | if ($db->transaction_supported()) $db->transaction_rollback(); |
|
- | 39 | throw new $e; |
|
- | 40 | } |
|
37 | 41 | ||
38 | return $version; |
42 | return $version; |
39 | } |
43 | } |