Commit 9397f9fc authored by Darryl Hamilton's avatar Darryl Hamilton

Fix validation errors in install.xml (bug #783804)

Update xmldb.xsd as required, fix all current install.xml
files, and add automatic validation to the minimum
acceptance test.

Requires xmllint - provided by libxml2-utils on debian/ubuntu.

Change-Id: Ia21862d79fc1429416bc55175aff1806e95c5fdb
Signed-off-by: 's avatarDarryl Hamilton <darrylh@catalyst.net.nz>
parent 7f60878d
...@@ -11,7 +11,9 @@ imageoptim: ...@@ -11,7 +11,9 @@ imageoptim:
find . -iname '*.jpeg' -exec jpegoptim -q -p --strip-all {} \; find . -iname '*.jpeg' -exec jpegoptim -q -p --strip-all {} \;
minaccept: minaccept:
@echo "Running minimum acceptance test..."; find htdocs/ -type f -name "*.php" | xargs -n 1 -P 2 php -l > /dev/null && echo All good! @echo "Running minimum acceptance test...";
find htdocs/ -type f -name "*.php" | xargs -n 1 -P 2 php -l > /dev/null && echo All good!
find htdocs/ -type f -name "install.xml" -path "*/db/install.xml" | xargs -n 1 -P 2 xmllint --schema htdocs/lib/xmldb/xmldb.xsd --noout
checksignoff: checksignoff:
@branch=`git status | head -1 | sed 's/.* On branch //'`; \ @branch=`git status | head -1 | sed 's/.* On branch //'`; \
......
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for Mahara files plugin tables" <XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for Mahara files plugin tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd" xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
> >
<TABLES> <TABLES>
<TABLE NAME="artefact_file_files"> <TABLE NAME="artefact_file_files">
......
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for Internal Artefact Mahara tables" <XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for Internal Artefact Mahara tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd" xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
> >
<TABLES> <TABLES>
<TABLE NAME="artefact_internal_profile_email"> <TABLE NAME="artefact_internal_profile_email">
......
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="artefact/plans/db" VERSION="20100525" COMMENT="XMLDB file for MyPlans Artefact Mahara tables" <XMLDB PATH="artefact/plans/db" VERSION="20100525" COMMENT="XMLDB file for MyPlans Artefact Mahara tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd" xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
> >
<TABLES> <TABLES>
......
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="artefact/resume/db" VERSION="20060926" COMMENT="XMLDB file for resume tables" <XMLDB PATH="artefact/resume/db" VERSION="20060926" COMMENT="XMLDB file for resume tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd" xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
> >
<TABLES> <TABLES>
<TABLE NAME="artefact_resume_personal_information"> <TABLE NAME="artefact_resume_personal_information">
...@@ -99,4 +99,4 @@ ...@@ -99,4 +99,4 @@
</KEYS> </KEYS>
</TABLE> </TABLE>
</TABLES> </TABLES>
</XML> </XMLDB>
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables" <XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd" xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
> >
<TABLES> <TABLES>
<TABLE NAME="blocktype_externalfeed_data"> <TABLE NAME="blocktype_externalfeed_data">
......
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables" <XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd" xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
> >
<TABLES> <TABLES>
<TABLE NAME="blocktype_wall_post"> <TABLE NAME="blocktype_wall_post">
......
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables" <XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd" xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
> >
<TABLES> <TABLES>
<TABLE NAME="interaction_forum_instance_config"> <TABLE NAME="interaction_forum_instance_config">
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<TABLE NAME="config"> <TABLE NAME="config">
<FIELDS> <FIELDS>
<FIELD NAME="field" TYPE="char" LENGTH="255" NOTNULL="true"/> <FIELD NAME="field" TYPE="char" LENGTH="255" NOTNULL="true"/>
<FIELD NAME="value" TYPE="text" LENGTH="small"/> <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="false"/>
</FIELDS> </FIELDS>
<KEYS> <KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="field" /> <KEY NAME="primary" TYPE="primary" FIELDS="field" />
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/> <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="username" TYPE="char" LENGTH="255" NOTNULL="true"/> <FIELD NAME="username" TYPE="char" LENGTH="255" NOTNULL="true"/>
<FIELD NAME="password" TYPE="char" LENGTH="40" NOTNULL="true"/> <FIELD NAME="password" TYPE="char" LENGTH="40" NOTNULL="true"/>
<FIELD NAME="salt" TYPE="char" LENGTH="8"/> <FIELD NAME="salt" TYPE="char" LENGTH="8" NOTNULL="false"/>
<FIELD NAME="passwordchange" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/> <FIELD NAME="passwordchange" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
<FIELD NAME="active" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1"/> <FIELD NAME="active" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1"/>
<FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/> <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" /> <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
<FIELD NAME="type" TYPE="int" LENGTH="10" NOTNULL="true" /> <FIELD NAME="type" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="data" TYPE="text" NOTNULL="true" /> <FIELD NAME="data" TYPE="text" NOTNULL="true" />
<FIELD NAME="ctime" TYPE="datetime" /> <FIELD NAME="ctime" TYPE="datetime" NOTNULL="false" />
</FIELDS> </FIELDS>
<KEYS> <KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" /> <KEY NAME="primary" TYPE="primary" FIELDS="id" />
...@@ -571,7 +571,7 @@ ...@@ -571,7 +571,7 @@
</TABLE> </TABLE>
<TABLE NAME="view_type"> <TABLE NAME="view_type">
<FIELDS> <FIELDS>
<FIELD NAME="type" TYPE="char" LENGTH="50" /> <FIELD NAME="type" TYPE="char" LENGTH="50" NOTNULL="true" />
</FIELDS> </FIELDS>
<KEYS> <KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="type" /> <KEY NAME="primary" TYPE="primary" FIELDS="type" />
...@@ -598,8 +598,8 @@ ...@@ -598,8 +598,8 @@
<FIELD NAME="ownerformat" TYPE="text" NOTNULL="false" /> <FIELD NAME="ownerformat" TYPE="text" NOTNULL="false" />
<FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="false" /> <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="false" />
<FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="false" /> <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="false" />
<FIELD NAME="startdate" TYPE="datetime" /> <FIELD NAME="startdate" TYPE="datetime" NOTNULL="false" />
<FIELD NAME="stopdate" TYPE="datetime" /> <FIELD NAME="stopdate" TYPE="datetime" NOTNULL="false" />
<FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" /> <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
<FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" /> <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
<FIELD NAME="atime" TYPE="datetime" NOTNULL="true" /> <FIELD NAME="atime" TYPE="datetime" NOTNULL="true" />
...@@ -607,7 +607,7 @@ ...@@ -607,7 +607,7 @@
<FIELD NAME="submittedhost" TYPE="char" LENGTH="255" NOTNULL="false" /> <FIELD NAME="submittedhost" TYPE="char" LENGTH="255" NOTNULL="false" />
<FIELD NAME="submittedtime" TYPE="datetime" NOTNULL="false" /> <FIELD NAME="submittedtime" TYPE="datetime" NOTNULL="false" />
<FIELD NAME="numcolumns" TYPE="int" LENGTH="2" NOTNULL="true" /> <FIELD NAME="numcolumns" TYPE="int" LENGTH="2" NOTNULL="true" />
<FIELD NAME="layout" TYPE="int" LENGTH="10"/> <FIELD NAME="layout" TYPE="int" LENGTH="10" NOTNULL="false"/>
<FIELD NAME="theme" TYPE="char" LENGTH="255" NOTNULL="false"/> <FIELD NAME="theme" TYPE="char" LENGTH="255" NOTNULL="false"/>
<FIELD NAME="template" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true" /> <FIELD NAME="template" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true" />
<FIELD NAME="copynewuser" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true" /> <FIELD NAME="copynewuser" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true" />
...@@ -743,7 +743,7 @@ ...@@ -743,7 +743,7 @@
<FIELDS> <FIELDS>
<FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" /> <FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" />
<FIELD NAME="content" TYPE="text" NOTNULL="true" /> <FIELD NAME="content" TYPE="text" NOTNULL="true" />
<FIELD NAME="ctime" TYPE="datetime" NOTNOT="true" /> <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
<FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" /> <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
<FIELD NAME="mauthor" TYPE="int" LENGTH="10" NOTNULL="false" /> <FIELD NAME="mauthor" TYPE="int" LENGTH="10" NOTNULL="false" />
</FIELDS> </FIELDS>
...@@ -770,8 +770,8 @@ ...@@ -770,8 +770,8 @@
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" /> <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
<FIELD NAME="host" TYPE="char" LENGTH="255" NOTNULL="true" /> <FIELD NAME="host" TYPE="char" LENGTH="255" NOTNULL="true" />
<FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" /> <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="queue" TYPE="int" LENGTH="1" NOTNULL="true" default="1" /> <FIELD NAME="queue" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
<FIELD NAME="ready" TYPE="int" LENGTH="1" NOTNULL="true" default="0" /> <FIELD NAME="ready" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
<FIELD NAME="expirytime" TYPE="datetime" NOTNULL="true" /> <FIELD NAME="expirytime" TYPE="datetime" NOTNULL="true" />
<FIELD NAME="format" TYPE="char" LENGTH="50" NOTNULL="false" /> <FIELD NAME="format" TYPE="char" LENGTH="50" NOTNULL="false" />
<FIELD NAME="data" TYPE="text" NOTNULL="false" /> <FIELD NAME="data" TYPE="text" NOTNULL="false" />
...@@ -787,7 +787,7 @@ ...@@ -787,7 +787,7 @@
<FIELDS> <FIELDS>
<FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" /> <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
<FIELD NAME="type" TYPE="char" LENGTH="255" NOTNULL="true" /> <FIELD NAME="type" TYPE="char" LENGTH="255" NOTNULL="true" />
<FIELD NAME="value" TYPE="text" LENGTH="small"/> <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="false"/>
</FIELDS> </FIELDS>
<KEYS> <KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="ctime,type" /> <KEY NAME="primary" TYPE="primary" FIELDS="ctime,type" />
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<xs:simpleType name="tableName" > <xs:simpleType name="tableName" >
<xs:restriction base="xs:string" > <xs:restriction base="xs:string" >
<xs:pattern value='[0-9a-z_]{1,28}'/> <xs:pattern value='[0-9a-z_]{1,40}'/>
</xs:restriction > </xs:restriction >
</xs:simpleType > </xs:simpleType >
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<xs:element name="FIELD"> <xs:element name="FIELD">
<xs:complexType> <xs:complexType>
<xs:attribute name="NAME" type="fieldName" use="required" /> <xs:attribute name="NAME" type="fieldName" use="required" />
<xs:attribute name="SEQUENCE" type="trueFalse" use="required" /> <xs:attribute name="SEQUENCE" type="trueFalse" use="optional" />
<xs:attribute name="TYPE" type="fieldType" use="required" /> <xs:attribute name="TYPE" type="fieldType" use="required" />
<xs:attribute name="LENGTH" type="fieldLength" use="optional" /> <xs:attribute name="LENGTH" type="fieldLength" use="optional" />
<xs:attribute name="NOTNULL" type="trueFalse" use="required" /> <xs:attribute name="NOTNULL" type="trueFalse" use="required" />
......
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables" <XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd" xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
> >
<TABLES> <TABLES>
<!-- not finalised, whoever implements this might want to change it --> <!-- not finalised, whoever implements this might want to change it -->
......
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables" <XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd" xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
> >
<TABLES> <TABLES>
<TABLE NAME="notification_internal_activity"> <TABLE NAME="notification_internal_activity">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment