Subversion Repositories oidplus

Rev

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

Rev 296 Rev 360
Line 20... Line 20...
20
// DATABASE UPDATE 202 -> 203
20
// DATABASE UPDATE 202 -> 203
21
// This script will be included by OIDplusDatabaseConnection.class.php inside function afterConnect().
21
// This script will be included by OIDplusDatabaseConnection.class.php inside function afterConnect().
22
// Parameters: $this is the OIDplusDatabaseConnection class
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)
23
//             $version is the current version (this script MUST increase the number by 1 when it is done)
24
 
24
 
25
if (!isset($version)) throw new OIDplusException("Argument 'version' is missing; was the file included in a wrong way?");
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("Argument 'this' is missing; was the file included in a wrong way?");
26
if (!isset($this))    throw new OIDplusException(_L('Argument "%1" is missing; was the file included in a wrong way?','this'));
27
 
27
 
28
if ($this->transaction_supported()) $this->transaction_begin();
28
if ($this->transaction_supported()) $this->transaction_begin();
29
 
29
 
30
if ($this->getSlang()::id() == 'mssql') {
30
if ($this->getSlang()::id() == 'mssql') {
31
        $sql = "CREATE FUNCTION [dbo].[getOidArc] (@strList varchar(512), @maxArcLen int, @occurence int)
31
        $this->query("CREATE FUNCTION [dbo].[getOidArc] (@strList varchar(512), @maxArcLen int, @occurence int)
32
        RETURNS varchar(512) AS
32
        RETURNS varchar(512) AS
33
        BEGIN
33
        BEGIN
34
                DECLARE @intPos int
34
                DECLARE @intPos int
35
 
35
 
36
                DECLARE @cnt int
36
                DECLARE @cnt int
Line 62... Line 62...
62
                                RETURN REPLICATE('0', @maxArcLen-len(@strList)) + @strList
62
                                RETURN REPLICATE('0', @maxArcLen-len(@strList)) + @strList
63
                        END
63
                        END
64
                END
64
                END
65
 
65
 
66
                RETURN REPLICATE('0', @maxArcLen)
66
                RETURN REPLICATE('0', @maxArcLen)
67
        END";
67
        END");
68
        $this->query($sql);
-
 
69
}
68
}
70
 
69
 
71
$version = 203;
70
$version = 203;
72
$this->query("UPDATE ###config SET value = ? WHERE name = 'database_version'", array($version));
71
$this->query("UPDATE ###config SET value = ? WHERE name = 'database_version'", array($version));
73
 
72