Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
e86d2073
Commit
e86d2073
authored
Apr 25, 2007
by
Penny Leach
Browse files
postgres upgrades so that postgres is in line with the schema
parent
f61a0d1a
Changes
7
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/file/db/upgrade.php
View file @
e86d2073
...
...
@@ -122,6 +122,16 @@ function xmldb_artefact_file_upgrade($oldversion=0) {
add_field
(
$table
,
$field
);
}
if
(
$oldversion
<
2007042500
)
{
// migrate everything we had to change to make mysql happy
$prefix
=
get_config
(
'dbprefix'
);
execute_sql
(
"ALTER TABLE
{
$prefix
}
artefact_file_file_types ALTER COLUMN description TYPE varchar(32)"
);
execute_sql
(
"ALTER TABLE
{
$prefix
}
artefact_file_mime_types ALTER COLUMN mimetype TYPE varchar(128)"
);
execute_sql
(
"ALTER TABLE
{
$prefix
}
artefact_file_mime_types ALTER COLUMN description TYPE varchar(32)"
);
}
// everything up to here we pre mysql support.
return
$status
;
}
...
...
htdocs/artefact/file/lib.php
View file @
e86d2073
...
...
@@ -173,14 +173,19 @@ class PluginArtefactFile extends PluginArtefact {
log_info
(
'Beginning resync of filetype list'
);
$currentlist
=
get_column
(
'artefact_file_file_types'
,
'description'
);
foreach
(
$currentlist
as
$c
)
{
log_debug
(
"c
$c
and trimmed is "
.
trim
(
$c
));
}
$newlist
=
xmlize
(
file_get_contents
(
get_config
(
'docroot'
)
.
'artefact/file/filetypes.xml'
));
$filetypes
=
$newlist
[
'filetypes'
][
'#'
][
'filetype'
];
$newfiletypes
=
array
();
//log_debug($currentlist);
// Step one: if a filetype is in the new list that is not in the current
// list, add it to the current list.
foreach
(
$filetypes
as
$filetype
)
{
$type
=
$filetype
[
'#'
][
'description'
][
0
][
'#'
];
error_log
(
"looking for
$type
"
);
if
(
!
in_array
(
$type
,
$currentlist
))
{
log_debug
(
'Adding filetype: '
.
$type
);
$currentlist
[]
=
$type
;
...
...
htdocs/artefact/file/version.php
View file @
e86d2073
...
...
@@ -27,7 +27,7 @@
defined
(
'INTERNAL'
)
||
die
();
$config
=
new
StdClass
;
$config
->
version
=
20070
21401
;
$config
->
version
=
20070
42500
;
$config
->
release
=
'0.3.1'
;
?>
htdocs/artefact/internal/db/upgrade.php
View file @
e86d2073
...
...
@@ -30,6 +30,15 @@ function xmldb_artefact_internal_upgrade($oldversion=0) {
$status
=
true
;
if
(
$oldversion
<
2007042500
)
{
// migrate everything we had to change to make mysql happy
$prefix
=
get_config
(
'dbprefix'
);
execute_sql
(
"ALTER TABLE
{
$prefix
}
artefact_internal_profile_email ALTER COLUMN email TYPE varchar(255)"
);
execute_sql
(
"ALTER TABLE
{
$prefix
}
artefact_internal_profile_icon ALTER COLUMN filename TYPE varchar(255)"
);
}
// everything up to here we pre mysql support.
return
$status
;
}
...
...
htdocs/artefact/internal/version.php
View file @
e86d2073
...
...
@@ -27,7 +27,7 @@
defined
(
'INTERNAL'
)
||
die
();
$config
=
new
StdClass
;
$config
->
version
=
20070
108
00
;
$config
->
version
=
20070
425
00
;
$config
->
release
=
'0.1'
;
?>
htdocs/lib/db/upgrade.php
View file @
e86d2073
...
...
@@ -247,6 +247,23 @@ function xmldb_core_upgrade($oldversion=0) {
upgrade_template
(
'blogandprofile'
,
$template
);
}
if
(
$oldversion
<
2007042500
)
{
// migrate everything we had to change to make mysql happy
execute_sql
(
"ALTER TABLE
{
$prefix
}
cron DROP CONSTRAINT
{
$prefix
}
cron_cal_pk"
);
// can't drop primary keys using xmldb...
execute_sql
(
"ALTER TABLE
{
$prefix
}
cron ADD CONSTRAINT
{
$prefix
}
cron_id_pk PRIMARY KEY (id)"
);
// or add them!
execute_sql
(
"ALTER TABLE
{
$prefix
}
cron ADD CONSTRAINT
{
$prefix
}
cron_cal_uk UNIQUE (callfunction)"
);
execute_sql
(
"ALTER TABLE
{
$prefix
}
community ALTER COLUMN name TYPE varchar (128)"
);
execute_sql
(
"ALTER TABLE
{
$prefix
}
usr_activity_preference ALTER COLUMN method TYPE varchar(255)"
);
execute_sql
(
"ALTER TABLE
{
$prefix
}
template_category ALTER COLUMN name TYPE varchar(128)"
);
execute_sql
(
"ALTER TABLE
{
$prefix
}
template_category ALTER COLUMN parent TYPE varchar(128)"
);
execute_sql
(
"ALTER TABLE
{
$prefix
}
template ALTER COLUMN name TYPE varchar(128)"
);
execute_sql
(
"ALTER TABLE
{
$prefix
}
template ALTER COLUMN category TYPE varchar(128)"
);
execute_sql
(
"ALTER TABLE
{
$prefix
}
view ALTER COLUMN template TYPE varchar(128)"
);
execute_sql
(
"ALTER TABLE
{
$prefix
}
view_access ALTER COLUMN accesstype SET DEFAULT 'public'"
);
}
// everything up to here we pre mysql support.
return
$status
;
}
...
...
htdocs/lib/version.php
View file @
e86d2073
...
...
@@ -27,7 +27,7 @@
defined
(
'INTERNAL'
)
||
die
();
$config
=
new
StdClass
;
$config
->
version
=
2007042
301
;
$config
->
version
=
2007042
500
;
$config
->
release
=
'0.8.0.dev'
;
$config
->
minupgradefrom
=
2007011600
;
$config
->
minupgraderelease
=
'0.4.0 (build tag BUILD_20070122)'
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment