<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="database" type="databaseType"/>
  <xs:complexType name="fieldType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute type="xs:string" name="type" use="optional"/>
        <xs:attribute type="xs:string" name="null" use="optional"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="tableType">
    <xs:sequence>
      <xs:element type="fieldType" name="field" maxOccurs="unbounded" minOccurs="0">
        <xs:annotation>
          <xs:documentation>NULL explicitly allowed</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element type="xs:string" name="primary" minOccurs="0"/>
      <xs:element type="xs:string" name="index" minOccurs="0"/>
      <xs:element type="xs:string" name="comment" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute type="xs:string" name="name" use="optional"/>
    <xs:attribute type="xs:string" name="no-site-reference" use="optional"/>
    <xs:attribute type="xs:string" name="engine" use="optional"/>
    <xs:attribute type="xs:string" name="site-types" use="optional"/>
    <xs:attribute type="xs:string" name="no-auto-update" use="optional"/>
  </xs:complexType>
  <xs:complexType name="globalType">
    <xs:sequence>
      <xs:element type="tableType" name="table"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="projectsType">
    <xs:sequence>
      <xs:element type="tableType" name="table" maxOccurs="unbounded" minOccurs="0">
        <xs:annotation>
          <xs:documentation>automatic site connect,
              site id is automatically added and at an update the attributes automaticly updated / inserted
        
              data table only for certain sites
              specific the site types in site-types="" attribute ... you can use shell wild cards
         no automatic site relationship, update, insert</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="databaseType">
    <xs:sequence>
      <xs:element type="globalType" name="global"/>
      <xs:element type="projectsType" name="projects"/>
    </xs:sequence>
  </xs:complexType>
</xs:schema>