Subversion Repositories oidplus

Rev

Rev 360 | Rev 511 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 360 Rev 386
Line 15... Line 15...
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
 * See the License for the specific language governing permissions and
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
17
 * limitations under the License.
18
 */
18
 */
19
 
19
 
20
// DATABASE UPDATE 200 -> 201
20
/**
21
// This script will be included by OIDplusDatabaseConnection.class.php inside function afterConnect().
21
 * This function will be called by OIDplusDatabaseConnection.class.php at method afterConnect().
22
// Parameters: $this is the OIDplusDatabaseConnection class
22
 * @param OIDplusDatabaseConnection $db is the OIDplusDatabaseConnection class
23
//             $version is the current version (this script MUST increase the number by 1 when it is done)
23
 * @param string $version is the current version (this script MUST increase the number by 1 when it is done)
-
 
24
 * @throws OIDplusException
24
 
25
 */
25
if (!isset($version)) throw new OIDplusException(_L('Argument "%1" is missing; was the file included in a wrong way?','version'));
26
function oidplus_dbupdate_200_201(OIDplusDatabaseConnection $db, string &$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();
27
    if ($db->transaction_supported()) $db->transaction_begin();
29
 
28
   
30
$this->query("ALTER TABLE ###objects ADD comment varchar(255) NULL");
29
    $db->query("ALTER TABLE ###objects ADD comment varchar(255) NULL");
31
 
30
   
32
$version = 201;
31
    $version = 201;
33
$this->query("UPDATE ###config SET value = ? WHERE name = 'database_version'", array($version));
32
    $db->query("UPDATE ###config SET value = ? WHERE name = 'database_version'", array($version));
34
 
33
   
35
if ($this->transaction_supported()) $this->transaction_commit();
-
 
36
34
    if ($db->transaction_supported()) $db->transaction_commit();
-
 
35
}
-
 
36
37
37