propelorm/Propel2

View on GitHub
resources/dtd/database.dtd

Summary

Maintainability
Test Coverage
<!--
    Propel XML database schema DTD

    This is based very closely on the schema DTD for Torque, but
    some differences do exist.
-->

<!--

defaultPhpNamingMethod determines how a table or column name,
from the name attribute in the xml database file, is converted to a
PHP class or method name.

     nochange   - indicates not change is performed.
     underscore - Underscores are removed, First letter is
              capitalized, first letter after an underscore
              is capitalized, the rest of the letters are
              converted to lowercase.
     phpname   - same as underscore, but no letters are converted
              to lowercase.
-->

<!ELEMENT database (external-schema*, table+, behavior*, vendor?)>
<!ATTLIST database
  name CDATA #IMPLIED
  defaultIdMethod (native|none) "none"
  package CDATA #IMPLIED
  schema CDATA #IMPLIED
  namespace CDATA #IMPLIED
  baseClass CDATA #IMPLIED
  baseQueryClass CDATA #IMPLIED
  defaultPhpNamingMethod (nochange|underscore|phpname) "underscore"
  heavyIndexing (true|false) "false"
  identifierQuoting (true|false) "false"
  tablePrefix CDATA #IMPLIED
  defaultStringFormat CDATA #IMPLIED
  xmlns:xsi CDATA #IMPLIED
  xsi:noNamespaceSchemaLocation CDATA #IMPLIED
>

<!ELEMENT external-schema EMPTY>
<!ATTLIST external-schema
  filename CDATA #REQUIRED
>

<!--
     note: the interface="true", requires that useManagers=true in the
     properties file.
-->
<!ELEMENT table (column+,(foreign-key|index|unique|id-method-parameter|behavior|vendor)*)>
<!ATTLIST table
  name CDATA #REQUIRED
  phpName CDATA #IMPLIED
  idMethod (native|autoincrement|sequence|none|null) "null"
  skipSql (true|false) "false"
  readOnly (true|false) "false"
  abstract (true|false) "false"
  isCrossRef (true|false) "false"
  allowPkInsert (true|false) "false"
  package CDATA #IMPLIED
  schema CDATA #IMPLIED
  namespace CDATA #IMPLIED
  baseClass CDATA #IMPLIED
  baseQueryClass CDATA #IMPLIED
  alias CDATA #IMPLIED
  interface CDATA #IMPLIED
  phpNamingMethod (nochange|underscore|phpname) #IMPLIED
  heavyIndexing (true|false) #IMPLIED
  identifierQuoting (true|false) #IMPLIED
  description CDATA #IMPLIED
  defaultStringFormat CDATA #IMPLIED
>

<!ELEMENT id-method-parameter EMPTY>
<!ATTLIST id-method-parameter
  name CDATA "default"
  value CDATA #REQUIRED
>

<!ELEMENT column ((inheritance|vendor)*)>
<!ATTLIST column
  name CDATA #REQUIRED
  phpName CDATA #IMPLIED
  tableMapName CDATA #IMPLIED
  primaryKey (true|false) "false"
  required (true|false) "false"
  type
    (
          BIT    | TINYINT | SMALLINT    | INTEGER    | BIGINT    | FLOAT
        | REAL   | NUMERIC | DECIMAL     | CHAR       | VARCHAR   | LONGVARCHAR
        | DATE   | TIME    | TIMESTAMP   | BINARY     | VARBINARY | LONGVARBINARY
        | NULL   | OTHER   | PHP_OBJECT  | DISTINCT   | STRUCT    | ARRAY
        | BLOB   | CLOB    | REF         | BOOLEANINT | BOOLEANCHAR
        | DOUBLE | BOOLEAN | OBJECT      | ENUM       | SET
    ) "VARCHAR"
  phpType CDATA #IMPLIED
  sqlType CDATA #IMPLIED
  size CDATA #IMPLIED
  scale CDATA #IMPLIED
  default CDATA #IMPLIED
  defaultValue CDATA #IMPLIED
  defaultExpr CDATA #IMPLIED
  autoIncrement (true|false) "false"
  inheritance (single|false) "false"
  phpNamingMethod (nochange|underscore|phpname) #IMPLIED
  description CDATA #IMPLIED
  typeHint CDATA #IMPLIED
  lazyLoad (true|false) "false"
  primaryString (true|false) "false"
  valueSet CDATA #IMPLIED
>

<!ELEMENT inheritance EMPTY>
<!ATTLIST inheritance
  key CDATA #REQUIRED
  class CDATA #REQUIRED
  package CDATA #IMPLIED
  extends CDATA #IMPLIED
>

<!ELEMENT foreign-key (reference+, vendor*)>
<!ATTLIST foreign-key
  foreignTable CDATA #REQUIRED
  foreignSchema CDATA #IMPLIED
  name CDATA #IMPLIED
  phpName CDATA #IMPLIED
  refPhpName CDATA #IMPLIED
  interface CDATA #IMPLIED
  onUpdate (CASCADE|cascade|SETNULL|setnull|RESTRICT|restrict|NOACTION|noaction|NONE|none) "none"
  onDelete (CASCADE|cascade|SETNULL|setnull|RESTRICT|restrict|NOACTION|noaction|NONE|none) "none"
  skipSql (true|false) "false"
>

<!ELEMENT reference EMPTY>
<!ATTLIST reference
  local CDATA #REQUIRED
  foreign CDATA #IMPLIED
  value CDATA #IMPLIED
>

<!ELEMENT index (index-column+,vendor*)>
<!ATTLIST index
  name CDATA #IMPLIED
>

<!ELEMENT behavior (parameter*)>
<!ATTLIST behavior
  name CDATA #IMPLIED
>

<!ELEMENT index-column (vendor*)>
<!ATTLIST index-column
  name CDATA #REQUIRED
  size CDATA #IMPLIED
>

<!ELEMENT unique (unique-column+)>
<!ATTLIST unique
  name CDATA #IMPLIED
>

<!ELEMENT unique-column (vendor*)>
<!ATTLIST unique-column
  name CDATA #REQUIRED
>

<!ELEMENT vendor (parameter+)>
<!ATTLIST vendor
  type CDATA #REQUIRED
>

<!ELEMENT parameter EMPTY>
<!ATTLIST parameter
  name CDATA #REQUIRED
  value CDATA #REQUIRED
>