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:
find . -iname '*.jpeg' -exec jpegoptim -q -p --strip-all {} \;
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:
@branch=`git status | head -1 | sed 's/.* On branch //'`; \
......
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for Mahara files plugin tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="artefact_file_files">
......
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for Internal Artefact Mahara tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="artefact_internal_profile_email">
......
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="artefact/plans/db" VERSION="20100525" COMMENT="XMLDB file for MyPlans Artefact Mahara tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
......
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="artefact/resume/db" VERSION="20060926" COMMENT="XMLDB file for resume tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="artefact_resume_personal_information">
......@@ -99,4 +99,4 @@
</KEYS>
</TABLE>
</TABLES>
</XML>
</XMLDB>
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="blocktype_externalfeed_data">
......
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="blocktype_wall_post">
......
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE NAME="interaction_forum_instance_config">
......
......@@ -8,7 +8,7 @@
<TABLE NAME="config">
<FIELDS>
<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>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="field" />
......@@ -78,7 +78,7 @@
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="username" TYPE="char" LENGTH="255" 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="active" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1"/>
<FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
......@@ -243,7 +243,7 @@
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
<FIELD NAME="type" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="data" TYPE="text" NOTNULL="true" />
<FIELD NAME="ctime" TYPE="datetime" />
<FIELD NAME="ctime" TYPE="datetime" NOTNULL="false" />
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" />
......@@ -571,7 +571,7 @@
</TABLE>
<TABLE NAME="view_type">
<FIELDS>
<FIELD NAME="type" TYPE="char" LENGTH="50" />
<FIELD NAME="type" TYPE="char" LENGTH="50" NOTNULL="true" />
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="type" />
......@@ -598,8 +598,8 @@
<FIELD NAME="ownerformat" TYPE="text" NOTNULL="false" />
<FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="false" />
<FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="false" />
<FIELD NAME="startdate" TYPE="datetime" />
<FIELD NAME="stopdate" TYPE="datetime" />
<FIELD NAME="startdate" TYPE="datetime" NOTNULL="false" />
<FIELD NAME="stopdate" TYPE="datetime" NOTNULL="false" />
<FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
<FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
<FIELD NAME="atime" TYPE="datetime" NOTNULL="true" />
......@@ -607,7 +607,7 @@
<FIELD NAME="submittedhost" TYPE="char" LENGTH="255" NOTNULL="false" />
<FIELD NAME="submittedtime" TYPE="datetime" NOTNULL="false" />
<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="template" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true" />
<FIELD NAME="copynewuser" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true" />
......@@ -743,7 +743,7 @@
<FIELDS>
<FIELD NAME="name" TYPE="char" LENGTH="50" 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="mauthor" TYPE="int" LENGTH="10" NOTNULL="false" />
</FIELDS>
......@@ -770,8 +770,8 @@
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
<FIELD NAME="host" TYPE="char" LENGTH="255" NOTNULL="true" />
<FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="queue" TYPE="int" LENGTH="1" NOTNULL="true" default="1" />
<FIELD NAME="ready" TYPE="int" LENGTH="1" NOTNULL="true" default="0" />
<FIELD NAME="queue" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
<FIELD NAME="ready" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
<FIELD NAME="expirytime" TYPE="datetime" NOTNULL="true" />
<FIELD NAME="format" TYPE="char" LENGTH="50" NOTNULL="false" />
<FIELD NAME="data" TYPE="text" NOTNULL="false" />
......@@ -787,7 +787,7 @@
<FIELDS>
<FIELD NAME="ctime" TYPE="datetime" 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>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="ctime,type" />
......
......@@ -10,7 +10,7 @@
<xs:simpleType name="tableName" >
<xs:restriction base="xs:string" >
<xs:pattern value='[0-9a-z_]{1,28}'/>
<xs:pattern value='[0-9a-z_]{1,40}'/>
</xs:restriction >
</xs:simpleType >
......@@ -66,7 +66,7 @@
<xs:element name="FIELD">
<xs:complexType>
<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="LENGTH" type="fieldLength" use="optional" />
<xs:attribute name="NOTNULL" type="trueFalse" use="required" />
......
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<!-- not finalised, whoever implements this might want to change it -->
......
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<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