PageRenderTime 31ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/generator/resources/xsd/database.xsd

https://github.com/1989gaurav/Propel
XML Schema | 918 lines | 865 code | 53 blank | 0 comment | 0 complexity | 42c4339630ee1591d2521fa81f393b7e MD5 | raw file
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  3. <!-- XML Schema for the Propel schema file
  4. An additional xml schema: custom_datatypes.xsd is
  5. also included. -->
  6. <xs:include schemaLocation="custom_datatypes.xsd"/>
  7. <xs:element name="database" type="database"/>
  8. <xs:element name="vendor" type="vendor"/>
  9. <xs:simpleType name="file">
  10. <xs:restriction base="xs:string">
  11. <!-- Match any relative or absolute path and file containing letters, numbers and _ -->
  12. <xs:pattern value="((\.{1,2}|[\w_]*)/)*([\w_]*\.?)+"/>
  13. </xs:restriction>
  14. </xs:simpleType>
  15. <xs:simpleType name="default_datatypes">
  16. <xs:restriction base="xs:string">
  17. <xs:enumeration value="BIT"/>
  18. <xs:enumeration value="TINYINT"/>
  19. <xs:enumeration value="SMALLINT"/>
  20. <xs:enumeration value="INTEGER"/>
  21. <xs:enumeration value="BIGINT"/>
  22. <xs:enumeration value="FLOAT"/>
  23. <xs:enumeration value="REAL"/>
  24. <xs:enumeration value="NUMERIC"/>
  25. <xs:enumeration value="DECIMAL"/>
  26. <xs:enumeration value="CHAR"/>
  27. <xs:enumeration value="VARCHAR"/>
  28. <xs:enumeration value="LONGVARCHAR"/>
  29. <xs:enumeration value="DATE"/>
  30. <xs:enumeration value="TIME"/>
  31. <xs:enumeration value="TIMESTAMP"/>
  32. <xs:enumeration value="BINARY"/>
  33. <xs:enumeration value="VARBINARY"/>
  34. <xs:enumeration value="LONGVARBINARY"/>
  35. <xs:enumeration value="NULL"/>
  36. <xs:enumeration value="OTHER"/>
  37. <xs:enumeration value="DISTINCT"/>
  38. <xs:enumeration value="STRUCT"/>
  39. <xs:enumeration value="BLOB"/>
  40. <xs:enumeration value="CLOB"/>
  41. <xs:enumeration value="REF"/>
  42. <xs:enumeration value="BOOLEANINT"/>
  43. <xs:enumeration value="BOOLEANCHAR"/>
  44. <xs:enumeration value="DOUBLE"/>
  45. <xs:enumeration value="BOOLEAN"/>
  46. <xs:enumeration value="OBJECT"/>
  47. <xs:enumeration value="ARRAY"/>
  48. <xs:enumeration value="ENUM"/>
  49. </xs:restriction>
  50. </xs:simpleType>
  51. <xs:simpleType name="datatype">
  52. <xs:union memberTypes="default_datatypes custom_datatypes"/>
  53. </xs:simpleType>
  54. <xs:simpleType name="dbidmethod">
  55. <xs:restriction base="xs:string">
  56. <xs:enumeration value="native"/>
  57. <xs:enumeration value="none"/>
  58. </xs:restriction>
  59. </xs:simpleType>
  60. <xs:simpleType name="tbidmethod">
  61. <xs:restriction base="xs:string">
  62. <xs:enumeration value="autoincrement"/>
  63. <xs:enumeration value="sequence"/>
  64. <xs:enumeration value="null"/>
  65. </xs:restriction>
  66. </xs:simpleType>
  67. <xs:simpleType name="idmethod">
  68. <xs:union memberTypes="dbidmethod tbidmethod"/>
  69. </xs:simpleType>
  70. <xs:simpleType name="phpnamingmethod">
  71. <xs:restriction base="xs:string">
  72. <xs:enumeration value="nochange"/>
  73. <xs:enumeration value="underscore"/>
  74. <xs:enumeration value="phpname"/>
  75. </xs:restriction>
  76. </xs:simpleType>
  77. <xs:simpleType name="delete">
  78. <xs:restriction base="xs:string">
  79. <xs:enumeration value="cascade"/>
  80. <xs:enumeration value="CASCADE"/>
  81. <xs:enumeration value="set null"/>
  82. <xs:enumeration value="SET NULL"/>
  83. <xs:enumeration value="setnull"/>
  84. <xs:enumeration value="SETNULL"/>
  85. <xs:enumeration value="restrict"/>
  86. <xs:enumeration value="RESTRICT"/>
  87. <xs:enumeration value="none"/>
  88. <xs:enumeration value="NONE"/>
  89. <xs:enumeration value=""/>
  90. </xs:restriction>
  91. </xs:simpleType>
  92. <xs:simpleType name="update">
  93. <xs:restriction base="xs:string">
  94. <xs:enumeration value="cascade"/>
  95. <xs:enumeration value="CASCADE"/>
  96. <xs:enumeration value="set null"/>
  97. <xs:enumeration value="SET NULL"/>
  98. <xs:enumeration value="setnull"/>
  99. <xs:enumeration value="SETNULL"/>
  100. <xs:enumeration value="restrict"/>
  101. <xs:enumeration value="RESTRICT"/>
  102. <xs:enumeration value="none"/>
  103. <xs:enumeration value="NONE"/>
  104. <xs:enumeration value=""/>
  105. </xs:restriction>
  106. </xs:simpleType>
  107. <xs:simpleType name="rulename">
  108. <xs:restriction base="xs:string">
  109. <xs:enumeration value="match"/>
  110. <xs:enumeration value="maxLength"/>
  111. <xs:enumeration value="maxValue"/>
  112. <xs:enumeration value="minLength"/>
  113. <xs:enumeration value="minValue"/>
  114. <xs:enumeration value="notMatch"/>
  115. <xs:enumeration value="required"/>
  116. <xs:enumeration value="type"/>
  117. <xs:enumeration value="unique"/>
  118. <xs:enumeration value="validValues"/>
  119. <!-- the next validators don't seem to be implemented, keeping them for BC -->
  120. <xs:enumeration value="mask"/>
  121. <xs:enumeration value="class"/>
  122. </xs:restriction>
  123. </xs:simpleType>
  124. <xs:simpleType name="inh_option">
  125. <xs:restriction base="xs:string">
  126. <xs:enumeration value="single"/>
  127. <xs:enumeration value="false"/>
  128. </xs:restriction>
  129. </xs:simpleType>
  130. <xs:simpleType name="sql_type">
  131. <xs:restriction base="xs:string">
  132. <xs:pattern value="[\w\s\[\]\(\),\.']+"/>
  133. </xs:restriction>
  134. </xs:simpleType>
  135. <xs:simpleType name="php_type">
  136. <xs:restriction base="xs:string">
  137. <xs:pattern value="[\w_]+"/>
  138. </xs:restriction>
  139. </xs:simpleType>
  140. <xs:simpleType name="treemode">
  141. <xs:restriction base="xs:string">
  142. <xs:enumeration value="AdjacencyList"/>
  143. <xs:enumeration value="MaterializedPath"/>
  144. <xs:enumeration value="NestedSet"/>
  145. </xs:restriction>
  146. </xs:simpleType>
  147. <!-- Visibility for column accessor and mutator methods -->
  148. <xs:simpleType name="visibility">
  149. <xs:restriction base="xs:string">
  150. <xs:enumeration value="public"/>
  151. <xs:enumeration value="protected"/>
  152. <xs:enumeration value="private"/>
  153. </xs:restriction>
  154. </xs:simpleType>
  155. <!-- Restrict column name to letters (upper- and lowercase), numbers and the _ -->
  156. <xs:simpleType name="column_name">
  157. <xs:restriction base="xs:string">
  158. <xs:pattern value="[\w_]+"/>
  159. </xs:restriction>
  160. </xs:simpleType>
  161. <!-- Restrict php name to letters (upper- and lowercase), numbers and the _ -->
  162. <xs:simpleType name="php_name">
  163. <xs:restriction base="xs:string">
  164. <xs:pattern value="[\w_]+"/>
  165. </xs:restriction>
  166. </xs:simpleType>
  167. <!-- Restrict php class name to letters (upper- and lowercase), numbers and the _. Dot seperated -->
  168. <xs:simpleType name="php_class">
  169. <xs:restriction base="xs:string">
  170. <xs:pattern value="([\w_]+.?)+"/>
  171. </xs:restriction>
  172. </xs:simpleType>
  173. <!-- Restrict php namespaces name to letters (upper- and lowercase), numbers and the backslash Dot seperated -->
  174. <xs:simpleType name="php_namespace">
  175. <xs:restriction base="xs:string">
  176. <xs:pattern value="(\\?[\w_]+)+"/>
  177. </xs:restriction>
  178. </xs:simpleType>
  179. <!-- Restrict table name to letters (upper- and lowercase), numbers and the _ -->
  180. <xs:simpleType name="table_name">
  181. <xs:restriction base="xs:string">
  182. <xs:pattern value="[\w_]+"/>
  183. </xs:restriction>
  184. </xs:simpleType>
  185. <!-- Restrict schema name to letters (upper- and lowercase), numbers and the _ -->
  186. <xs:simpleType name="schema_name">
  187. <xs:restriction base="xs:string">
  188. <xs:pattern value="[\w_]+"/>
  189. </xs:restriction>
  190. </xs:simpleType>
  191. <!-- Restrict index name to letters (upper- and lowercase), numbers and the _ -->
  192. <xs:simpleType name="index_name">
  193. <xs:restriction base="xs:string">
  194. <xs:pattern value="[\w_]+"/>
  195. </xs:restriction>
  196. </xs:simpleType>
  197. <!-- Restrict foreign column name to letters (upper- and lowercase), numbers and the _ -->
  198. <xs:simpleType name="foreign_name">
  199. <xs:restriction base="xs:string">
  200. <xs:pattern value="[\w_]+"/>
  201. </xs:restriction>
  202. </xs:simpleType>
  203. <xs:complexType name="parameter">
  204. <xs:attribute name="name" type="xs:string" use="required"/>
  205. <xs:attribute name="value" type="xs:string" use="required"/>
  206. </xs:complexType>
  207. <xs:complexType name="validator">
  208. <xs:sequence>
  209. <xs:element name="rule" type="rule" maxOccurs="unbounded"/>
  210. </xs:sequence>
  211. <xs:attribute name="column" type="column_name" use="required"/>
  212. <xs:attribute name="translate" type="xs:string" use="optional"/>
  213. </xs:complexType>
  214. <xs:complexType name="vendor">
  215. <xs:sequence>
  216. <xs:element name="parameter" type="parameter" maxOccurs="unbounded"/>
  217. </xs:sequence>
  218. <xs:attribute name="type" use="required"/>
  219. </xs:complexType>
  220. <xs:complexType name="rule">
  221. <xs:attribute name="name" type="rulename" use="required"/>
  222. <xs:attribute name="value" type="xs:string" use="optional"/>
  223. <xs:attribute name="size" type="xs:positiveInteger" use="optional"/>
  224. <xs:attribute name="message" type="xs:string" use="optional"/>
  225. <xs:attribute name="class" type="xs:string" use="optional"/>
  226. </xs:complexType>
  227. <xs:complexType name="id-method-parameter">
  228. <xs:attribute name="name" type="xs:string" use="optional"/>
  229. <xs:attribute name="value" type="xs:string" use="required"/>
  230. </xs:complexType>
  231. <xs:complexType name="index">
  232. <xs:choice maxOccurs="unbounded">
  233. <xs:element name="index-column" type="index-column" minOccurs="1" maxOccurs="unbounded"/>
  234. <xs:element ref="vendor" minOccurs="0" maxOccurs="unbounded"/>
  235. </xs:choice>
  236. <xs:attribute name="name" type="index_name" use="optional"/>
  237. </xs:complexType>
  238. <xs:complexType name="unique">
  239. <xs:choice maxOccurs="unbounded">
  240. <xs:element name="unique-column" type="unique-column" minOccurs="1" maxOccurs="unbounded"/>
  241. <xs:element ref="vendor" minOccurs="0" maxOccurs="unbounded"/>
  242. </xs:choice>
  243. <xs:attribute name="name" type="index_name" use="optional"/>
  244. </xs:complexType>
  245. <xs:complexType name="index-column">
  246. <xs:sequence>
  247. <xs:element ref="vendor" minOccurs="0" maxOccurs="unbounded"/>
  248. </xs:sequence>
  249. <xs:attribute name="name" type="column_name" use="required"/>
  250. <xs:attribute name="size" type="xs:positiveInteger" use="optional"/>
  251. </xs:complexType>
  252. <xs:complexType name="unique-column">
  253. <xs:sequence>
  254. <xs:element ref="vendor" minOccurs="0" maxOccurs="unbounded"/>
  255. </xs:sequence>
  256. <xs:attribute name="name" type="column_name" use="required"/>
  257. <xs:attribute name="size" type="xs:positiveInteger" use="optional"/>
  258. </xs:complexType>
  259. <xs:complexType name="inheritance">
  260. <xs:attribute name="key" type="xs:string" use="required"/>
  261. <xs:attribute name="class" type="xs:string" use="required"/>
  262. <xs:attribute name="package" type="xs:string" use="optional"/>
  263. <xs:attribute name="extends" type="xs:string" use="optional"/>
  264. </xs:complexType>
  265. <xs:complexType name="reference">
  266. <xs:attribute name="local" type="column_name" use="required"/>
  267. <xs:attribute name="foreign" type="column_name" use="required"/>
  268. </xs:complexType>
  269. <xs:complexType name="behavior">
  270. <xs:choice maxOccurs="unbounded">
  271. <xs:element name="parameter" type="parameter" minOccurs="0" maxOccurs="unbounded"/>
  272. </xs:choice>
  273. <xs:attribute name="name" type="xs:string" use="required"/>
  274. </xs:complexType>
  275. <xs:complexType name="column">
  276. <xs:choice maxOccurs="unbounded">
  277. <xs:element name="inheritance" type="inheritance" minOccurs="0" maxOccurs="unbounded"/>
  278. <xs:element ref="vendor" minOccurs="0" maxOccurs="unbounded"/>
  279. </xs:choice>
  280. <xs:attribute name="name" type="column_name" use="required">
  281. <xs:annotation>
  282. <xs:documentation xml:lang="en">
  283. The name of the column as it appears in the database.
  284. </xs:documentation>
  285. </xs:annotation>
  286. </xs:attribute>
  287. <xs:attribute name="phpName" type="php_name" use="optional">
  288. <xs:annotation>
  289. <xs:documentation xml:lang="en">
  290. Name used in PHP code to reference this column (in getters, setters, etc.). Defaults to the name transformed by the phpNamingMethod, which defaults to a CamelCase converter. So by default, a column named 'author_id' receives 'AuthorId' as phpName.
  291. </xs:documentation>
  292. </xs:annotation>
  293. </xs:attribute>
  294. <xs:attribute name="peerName" type="php_class" use="optional">
  295. <xs:annotation>
  296. <xs:documentation xml:lang="en">
  297. Name used for the class constant corresponding to this column in PHP code. Defaults to the uppercase name, so a column named 'author_id' receives 'AUTHOR_ID' as peerName.
  298. </xs:documentation>
  299. </xs:annotation>
  300. </xs:attribute>
  301. <xs:attribute name="prefix" type="column_name" use="optional"/>
  302. <xs:attribute name="accessorVisibility" type="visibility" use="optional">
  303. <xs:annotation>
  304. <xs:documentation xml:lang="en">
  305. Visibility for the column accessor method. 'public' by default, also accepts 'protected' and 'private'.
  306. </xs:documentation>
  307. </xs:annotation>
  308. </xs:attribute>
  309. <xs:attribute name="mutatorVisibility" type="visibility" use="optional">
  310. <xs:annotation>
  311. <xs:documentation xml:lang="en">
  312. Visibility for the column mutator method. 'public' by default, also accepts 'protected' and 'private'.
  313. </xs:documentation>
  314. </xs:annotation>
  315. </xs:attribute>
  316. <xs:attribute name="primaryKey" type="xs:boolean" default="false">
  317. <xs:annotation>
  318. <xs:documentation xml:lang="en">
  319. Set to true to add a primary key on this column.
  320. </xs:documentation>
  321. </xs:annotation>
  322. </xs:attribute>
  323. <xs:attribute name="required" type="xs:boolean" default="false">
  324. <xs:annotation>
  325. <xs:documentation xml:lang="en">
  326. Set to true to forbid NULL values.
  327. </xs:documentation>
  328. </xs:annotation>
  329. </xs:attribute>
  330. <xs:attribute name="type" type="datatype" default="VARCHAR">
  331. <xs:annotation>
  332. <xs:documentation xml:lang="en">
  333. Any of the Propel supported data types. These types are database-agnostic, and converted to the native database type according to the connection.
  334. </xs:documentation>
  335. </xs:annotation>
  336. </xs:attribute>
  337. <xs:attribute name="sqlType" type="sql_type" use="optional">
  338. <xs:annotation>
  339. <xs:documentation xml:lang="en">
  340. Native database column type.
  341. </xs:documentation>
  342. </xs:annotation>
  343. </xs:attribute>
  344. <xs:attribute name="phpType" type="php_type" use="optional">
  345. <xs:annotation>
  346. <xs:documentation xml:lang="en">
  347. PHP type for te column in PHP code. This column's setter uses type casting with the set php_type; besides, generated phpDoc in the model classes use this attribute for code completion.
  348. </xs:documentation>
  349. </xs:annotation>
  350. </xs:attribute>
  351. <xs:attribute name="size" type="xs:nonNegativeInteger" use="optional">
  352. <xs:annotation>
  353. <xs:documentation xml:lang="en">
  354. Numeric length of the column.
  355. </xs:documentation>
  356. </xs:annotation>
  357. </xs:attribute>
  358. <xs:attribute name="scale" type="xs:nonNegativeInteger" use="optional">
  359. <xs:annotation>
  360. <xs:documentation xml:lang="en">
  361. Digits after decimal place
  362. </xs:documentation>
  363. </xs:annotation>
  364. </xs:attribute>
  365. <xs:attribute name="default" type="xs:string" use="optional">
  366. <xs:annotation>
  367. <xs:documentation xml:lang="en">
  368. Synonym for defaultValue
  369. </xs:documentation>
  370. </xs:annotation>
  371. </xs:attribute>
  372. <xs:attribute name="defaultValue" type="xs:string" use="optional">
  373. <xs:annotation>
  374. <xs:documentation xml:lang="en">
  375. The default value that the object will have for this column in the PHP instance after creating a "new Object". This value is always interpreted as a string. See defaultExpr for setting an SQL function as a default value.
  376. </xs:documentation>
  377. </xs:annotation>
  378. </xs:attribute>
  379. <xs:attribute name="defaultExpr" type="xs:string" use="optional">
  380. <xs:annotation>
  381. <xs:documentation xml:lang="en">
  382. The default value for this column as expressed in SQL. This value is used solely for the "sql" target which builds your database from the schema.xml file. The defaultExpr is the SQL expression used as the "default" for the column.
  383. </xs:documentation>
  384. </xs:annotation>
  385. </xs:attribute>
  386. <xs:attribute name="autoIncrement" type="xs:boolean" default="false"/>
  387. <xs:attribute name="inheritance" type="inh_option" default="false"/>
  388. <xs:attribute name="phpNamingMethod" type="phpnamingmethod" use="optional">
  389. <xs:annotation>
  390. <xs:documentation xml:lang="en">
  391. Name of the method used to transform the column name into a phpName. Defaults to 'clean', which Removes any character that is not a letter or a number and capitilizes the first letter of the name, the first letter of each alphanumeric block, and converts the rest of the letters to lowercase. Possible values: any of the PhpNameGenerator CONV_METHOD_XXX constants (clean, underscore, phpName, nochange).
  392. </xs:documentation>
  393. </xs:annotation>
  394. </xs:attribute>
  395. <xs:attribute name="description" type="xs:string" use="optional">
  396. <xs:annotation>
  397. <xs:documentation xml:lang="en">
  398. A text description of the column. It gets added to the SQL CREATE table as a comment, and appears in the phpDoc bloc of the related getter and setter methods in the ActiveRecord class.
  399. </xs:documentation>
  400. </xs:annotation>
  401. </xs:attribute>
  402. <xs:attribute name="lazyLoad" type="xs:boolean" default="false">
  403. <xs:annotation>
  404. <xs:documentation xml:lang="en">
  405. Set to true to skip this column by default during hydration. That means that this column will be hydrated on demand, using a supplementary query. Mostly useful for LOB columns.
  406. </xs:documentation>
  407. </xs:annotation>
  408. </xs:attribute>
  409. <xs:attribute name="nodeKeySep" type="xs:string" use="optional">
  410. <xs:annotation>
  411. <xs:documentation xml:lang="en">
  412. (DEPRECATED) For use with treeMode table attribute.
  413. </xs:documentation>
  414. </xs:annotation>
  415. </xs:attribute>
  416. <xs:attribute name="nodeKey" type="xs:string" use="optional">
  417. <xs:annotation>
  418. <xs:documentation xml:lang="en">
  419. (DEPRECATED) For use with treeMode table attribute.
  420. </xs:documentation>
  421. </xs:annotation>
  422. </xs:attribute>
  423. <xs:attribute name="nestedSetLeftKey" type="xs:boolean" default="false">
  424. <xs:annotation>
  425. <xs:documentation xml:lang="en">
  426. (DEPRECATED) For use with treeMode table attribute.
  427. </xs:documentation>
  428. </xs:annotation>
  429. </xs:attribute>
  430. <xs:attribute name="nestedSetRightKey" type="xs:boolean" default="false">
  431. <xs:annotation>
  432. <xs:documentation xml:lang="en">
  433. (DEPRECATED) For use with treeMode table attribute.
  434. </xs:documentation>
  435. </xs:annotation>
  436. </xs:attribute>
  437. <xs:attribute name="treeScopeKey" type="xs:boolean" default="false">
  438. <xs:annotation>
  439. <xs:documentation xml:lang="en">
  440. (DEPRECATED) For use with treeMode table attribute.
  441. </xs:documentation>
  442. </xs:annotation>
  443. </xs:attribute>
  444. <xs:attribute name="primaryString" type="xs:boolean" default="false">
  445. <xs:annotation>
  446. <xs:documentation xml:lang="en">
  447. A column defined as primary string serves as default value for a `__toString()` method in the generated Propel object.
  448. </xs:documentation>
  449. </xs:annotation>
  450. </xs:attribute>
  451. <xs:attribute name="valueSet" type="xs:string" use="optional">
  452. <xs:annotation>
  453. <xs:documentation xml:lang="en">
  454. The list of values for an ENUM column, separated by commas
  455. </xs:documentation>
  456. </xs:annotation>
  457. </xs:attribute>
  458. </xs:complexType>
  459. <xs:complexType name="foreign-key">
  460. <xs:choice maxOccurs="unbounded">
  461. <xs:element name="reference" type="reference" minOccurs="1" maxOccurs="unbounded">
  462. <xs:annotation>
  463. <xs:documentation xml:lang="en">
  464. A reference between a local and a foreign column. Composite foreign keys can have several references.
  465. </xs:documentation>
  466. </xs:annotation>
  467. </xs:element>
  468. <xs:element ref="vendor" minOccurs="0" maxOccurs="unbounded"/>
  469. </xs:choice>
  470. <xs:attribute name="foreignTable" type="table_name" use="required">
  471. <xs:annotation>
  472. <xs:documentation xml:lang="en">
  473. The other table name
  474. </xs:documentation>
  475. </xs:annotation>
  476. </xs:attribute>
  477. <xs:attribute name="foreignSchema" type="schema_name" use="optional">
  478. <xs:annotation>
  479. <xs:documentation xml:lang="en">
  480. The other schema name
  481. </xs:documentation>
  482. </xs:annotation>
  483. </xs:attribute>
  484. <xs:attribute name="name" type="foreign_name" use="optional">
  485. <xs:annotation>
  486. <xs:documentation xml:lang="en">
  487. Name for this foreign key
  488. </xs:documentation>
  489. </xs:annotation>
  490. </xs:attribute>
  491. <xs:attribute name="phpName" type="php_name" use="optional">
  492. <xs:annotation>
  493. <xs:documentation xml:lang="en">
  494. Name for the foreign object in methods generated in this class.
  495. </xs:documentation>
  496. </xs:annotation>
  497. </xs:attribute>
  498. <xs:attribute name="refPhpName" type="php_name" use="optional">
  499. <xs:annotation>
  500. <xs:documentation xml:lang="en">
  501. Name for this object in methods generated in the foreign class
  502. </xs:documentation>
  503. </xs:annotation>
  504. </xs:attribute>
  505. <xs:attribute name="defaultJoin" type="xs:string" use="optional">
  506. <xs:annotation>
  507. <xs:documentation xml:lang="en">
  508. This affects the default join type used in the generated `joinXXX()` methods in the model query class. Propel uses an INNER JOIN for foreign keys attached to a required column, and a LEFT JOIN for foreign keys attached to a non-required column, but you can override this in the foreign key element.
  509. </xs:documentation>
  510. </xs:annotation>
  511. </xs:attribute>
  512. <xs:attribute name="onDelete" type="delete" default="none"/>
  513. <xs:attribute name="onUpdate" type="update" default="none"/>
  514. <xs:attribute name="skipSql" type="xs:boolean" default="false">
  515. <xs:annotation>
  516. <xs:documentation xml:lang="en">
  517. Instructs Propel not to generate DDL SQL for the specified foreign key. This can be used to support relationships in the model without an actual foreign key.
  518. </xs:documentation>
  519. </xs:annotation>
  520. </xs:attribute>
  521. </xs:complexType>
  522. <xs:complexType name="external-schema">
  523. <xs:attribute name="filename" type="file" use="required">
  524. <xs:annotation>
  525. <xs:documentation xml:lang="en">
  526. The (absolute or relative to this schema dir name) path to the external schema file.
  527. </xs:documentation>
  528. </xs:annotation>
  529. </xs:attribute>
  530. </xs:complexType>
  531. <xs:complexType name="table">
  532. <xs:choice maxOccurs="unbounded">
  533. <xs:element name="column" type="column" maxOccurs="unbounded">
  534. <xs:annotation>
  535. <xs:documentation xml:lang="en">
  536. A column of the table
  537. </xs:documentation>
  538. </xs:annotation>
  539. </xs:element>
  540. <xs:element name="foreign-key" type="foreign-key" minOccurs="0" maxOccurs="unbounded">
  541. <xs:annotation>
  542. <xs:documentation xml:lang="en">
  543. A foreign key on one or several columns in this table, referencing a foreign table
  544. </xs:documentation>
  545. </xs:annotation>
  546. </xs:element>
  547. <xs:element name="index" type="index" minOccurs="0" maxOccurs="unbounded">
  548. <xs:annotation>
  549. <xs:documentation xml:lang="en">
  550. An index on one or several columns of the current table
  551. </xs:documentation>
  552. </xs:annotation>
  553. </xs:element>
  554. <xs:element name="unique" type="unique" minOccurs="0" maxOccurs="unbounded">
  555. <xs:annotation>
  556. <xs:documentation xml:lang="en">
  557. A unique index on one or several columns of the current table
  558. </xs:documentation>
  559. </xs:annotation>
  560. </xs:element>
  561. <xs:element name="id-method-parameter" type="id-method-parameter" minOccurs="0" maxOccurs="unbounded">
  562. <xs:annotation>
  563. <xs:documentation xml:lang="en">
  564. If you are using a database that uses sequences for auto-increment columns (e.g. PostgreSQL or Oracle), you can customize the name of the sequence using this tag
  565. </xs:documentation>
  566. </xs:annotation>
  567. </xs:element>
  568. <xs:element name="validator" type="validator" minOccurs="0" maxOccurs="unbounded">
  569. <xs:annotation>
  570. <xs:documentation xml:lang="en">
  571. A validator to be executed on a given column at runtime
  572. </xs:documentation>
  573. </xs:annotation>
  574. </xs:element>
  575. <xs:element name="behavior" type="behavior" minOccurs="0" maxOccurs="unbounded">
  576. <xs:annotation>
  577. <xs:documentation xml:lang="en">
  578. A behavior to be added to the current table. Can modify the table structure, as well as modify the runtime code of the generated Model objects linked to this table. Bundled behaviors include alternative_coding_standards, auto_add_pk, timestampable, sluggable, soft_delete, sortable, nested_set, query_cache, and concrete_inheritance.
  579. </xs:documentation>
  580. </xs:annotation>
  581. </xs:element>
  582. <xs:element ref="vendor" minOccurs="0" maxOccurs="unbounded">
  583. <xs:annotation>
  584. <xs:documentation xml:lang="en">
  585. table attributes specific to a database vendor. Only supports MySQL specific table attributes for now (Charset, Collate, Checksum, Pack_keys, Delay_key_write).
  586. </xs:documentation>
  587. </xs:annotation>
  588. </xs:element>
  589. </xs:choice>
  590. <xs:attribute name="name" type="table_name" use="required">
  591. <xs:annotation>
  592. <xs:documentation xml:lang="en">
  593. The name of the table as it appears in the database.
  594. </xs:documentation>
  595. </xs:annotation>
  596. </xs:attribute>
  597. <xs:attribute name="schema" type="schema_name" use="optional">
  598. <xs:annotation>
  599. <xs:documentation xml:lang="en">
  600. The table's schema for RDBMs supporting multiple schemas per database.
  601. </xs:documentation>
  602. </xs:annotation>
  603. </xs:attribute>
  604. <xs:attribute name="phpName" type="php_class" use="optional">
  605. <xs:annotation>
  606. <xs:documentation xml:lang="en">
  607. The name of the ActiveRecord class generated for this table. Defaults to the name transformed by the phpNamingMethod, which defaults to a CamelCase converter. So by default, a table named 'foo_author' receives 'FooAuthor' as phpName.
  608. </xs:documentation>
  609. </xs:annotation>
  610. </xs:attribute>
  611. <xs:attribute name="namespace" type="php_namespace" use="optional">
  612. <xs:annotation>
  613. <xs:documentation xml:lang="en">
  614. The PHP 5.3 namespace to use for the generated model classes.
  615. </xs:documentation>
  616. </xs:annotation>
  617. </xs:attribute>
  618. <xs:attribute name="columnPrefix" type="column_name" use="optional"/>
  619. <xs:attribute name="defaultAccessorVisibility" type="visibility" use="optional">
  620. <xs:annotation>
  621. <xs:documentation xml:lang="en">
  622. Default visibility for column accessor methods. 'public' by default, also accepts 'protected' and 'private'.
  623. </xs:documentation>
  624. </xs:annotation>
  625. </xs:attribute>
  626. <xs:attribute name="defaultMutatorVisibility" type="visibility" use="optional">
  627. <xs:annotation>
  628. <xs:documentation xml:lang="en">
  629. Default visibility for column mutator methods. 'public' by default, also accepts 'protected' and 'private'.
  630. </xs:documentation>
  631. </xs:annotation>
  632. </xs:attribute>
  633. <xs:attribute name="idMethod" type="idmethod" use="optional">
  634. <xs:annotation>
  635. <xs:documentation xml:lang="en">
  636. Id method to use for auto-increment columns.
  637. </xs:documentation>
  638. </xs:annotation>
  639. </xs:attribute>
  640. <xs:attribute name="allowPkInsert" type="xs:boolean" default="false" use="optional">
  641. <xs:annotation>
  642. <xs:documentation xml:lang="en">
  643. Can be used if you want to define the primary key of a new object being inserted. By default if idMethod is "native", Propel would throw an exception. However, in some cases this feature is useful, for example if you do some replication of data in an master-master environment.
  644. </xs:documentation>
  645. </xs:annotation>
  646. </xs:attribute>
  647. <xs:attribute name="skipSql" type="xs:boolean" default="false">
  648. <xs:annotation>
  649. <xs:documentation xml:lang="en">
  650. Instructs Propel not to generate DDL SQL for the specified table. This can be used together with readOnly for supporting VIEWS in Propel
  651. </xs:documentation>
  652. </xs:annotation>
  653. </xs:attribute>
  654. <xs:attribute name="readOnly" type="xs:boolean" default="false">
  655. <xs:annotation>
  656. <xs:documentation xml:lang="en">
  657. Suppresses the mutator/setter methods, save() and delete() methods.
  658. </xs:documentation>
  659. </xs:annotation>
  660. </xs:attribute>
  661. <xs:attribute name="abstract" type="xs:boolean" default="false">
  662. <xs:annotation>
  663. <xs:documentation xml:lang="en">
  664. Whether the generated stub class will be abstract (e.g. if you're using inheritance)
  665. </xs:documentation>
  666. </xs:annotation>
  667. </xs:attribute>
  668. <xs:attribute name="baseClass" type="php_class" use="optional">
  669. <xs:annotation>
  670. <xs:documentation xml:lang="en">
  671. Allows you to specify a class that the generated Propel objects should extend (in place of propel.om.BaseObject)
  672. </xs:documentation>
  673. </xs:annotation>
  674. </xs:attribute>
  675. <xs:attribute name="basePeer" type="php_class" use="optional">
  676. <xs:annotation>
  677. <xs:documentation xml:lang="en">
  678. Instructs Propel to use a different SQL-generating BasePeer class (or sub-class of BasePeer).
  679. </xs:documentation>
  680. </xs:annotation>
  681. </xs:attribute>
  682. <xs:attribute name="alias" type="table_name" use="optional"/>
  683. <xs:attribute name="package" type="xs:string" use="optional">
  684. <xs:annotation>
  685. <xs:documentation xml:lang="en">
  686. Specifies the "package" for the generated classes. Classes are created in subdirectories according to the package attribute value.
  687. </xs:documentation>
  688. </xs:annotation>
  689. </xs:attribute>
  690. <xs:attribute name="interface" type="xs:string" use="optional"/>
  691. <xs:attribute name="phpNamingMethod" type="phpnamingmethod" use='optional'>
  692. <xs:annotation>
  693. <xs:documentation xml:lang="en">
  694. Name of the method used to transform the table name into a phpName. Defaults to 'clean', which Removes any character that is not a letter or a number and capitilizes the first letter of the name, the first letter of each alphanumeric block, and converts the rest of the letters to lowercase. Possible values: any of the PhpNameGenerator CONV_METHOD_XXX constants (clean, underscore, phpName, nochange).
  695. </xs:documentation>
  696. </xs:annotation>
  697. </xs:attribute>
  698. <xs:attribute name="heavyIndexing" type="xs:boolean" use="optional">
  699. <xs:annotation>
  700. <xs:documentation xml:lang="en">
  701. Adds indexes for each component of the primary key (when using composite primary keys)
  702. </xs:documentation>
  703. </xs:annotation>
  704. </xs:attribute>
  705. <xs:attribute name="description" type="xs:string" use="optional">
  706. <xs:annotation>
  707. <xs:documentation xml:lang="en">
  708. A text description of the table. It gets added to the SQL CREATE table as a comment, and appears in the phpDoc bloc of the related ActiveRecord class.
  709. </xs:documentation>
  710. </xs:annotation>
  711. </xs:attribute>
  712. <xs:attribute name="treeMode" type="treemode" use="optional">
  713. <xs:annotation>
  714. <xs:documentation xml:lang="en">
  715. Used to indicate that this table is part of a node tree. Currently the only supported values are "NestedSet" and "MaterializedPath" (DEPRECATED: use nested_set behavior instead).
  716. </xs:documentation>
  717. </xs:annotation>
  718. </xs:attribute>
  719. <xs:attribute name="reloadOnInsert" type="xs:boolean" default="false">
  720. <xs:annotation>
  721. <xs:documentation xml:lang="en">
  722. Indicate that the object should be reloaded from the database when an INSERT is performed. This is useful if you have triggers (or other server-side functionality like column default expressions) that alters the database row on INSERT.
  723. </xs:documentation>
  724. </xs:annotation>
  725. </xs:attribute>
  726. <xs:attribute name="reloadOnUpdate" type="xs:boolean" default="false">
  727. <xs:annotation>
  728. <xs:documentation xml:lang="en">
  729. Indicate that the object should be reloaded from the database when an UPDATE is performed. This is useful if you have triggers (or other server-side functionality like column default expressions) that alters the database row on UPDATE.
  730. </xs:documentation>
  731. </xs:annotation>
  732. </xs:attribute>
  733. <xs:attribute name="isCrossRef" type="xs:boolean" default="false">
  734. <xs:annotation>
  735. <xs:documentation xml:lang="en">
  736. Set to true if the current table is a cross-reference table in a many-to-many relationship to allow generation of getter and setter in each of the tables of the relationship.
  737. </xs:documentation>
  738. </xs:annotation>
  739. </xs:attribute>
  740. <xs:attribute name="defaultStringFormat" type="xs:string" use="optional">
  741. <xs:annotation>
  742. <xs:documentation xml:lang="en">
  743. The default format used to convert objects based on this table to strings. Propel supports by default the 'XML', 'YAML', 'JSON', and 'CSV' formats, but custom formats are also possible.
  744. </xs:documentation>
  745. </xs:annotation>
  746. </xs:attribute>
  747. </xs:complexType>
  748. <xs:complexType name="database">
  749. <xs:choice maxOccurs="unbounded">
  750. <xs:element name="external-schema" type="external-schema" minOccurs="0" maxOccurs="unbounded">
  751. <xs:annotation>
  752. <xs:documentation xml:lang="en">
  753. Embed an external schema file into the current schema. Accepts absolute and relative schema file paths.
  754. </xs:documentation>
  755. </xs:annotation>
  756. </xs:element>
  757. <xs:element name="table" type="table" minOccurs="1" maxOccurs="unbounded">
  758. <xs:annotation>
  759. <xs:documentation xml:lang="en">
  760. A table using the database connection.
  761. </xs:documentation>
  762. </xs:annotation>
  763. </xs:element>
  764. <xs:element name="behavior" type="behavior" minOccurs="0" maxOccurs="unbounded">
  765. <xs:annotation>
  766. <xs:documentation xml:lang="en">
  767. Behavior to be applied to all the database tables
  768. </xs:documentation>
  769. </xs:annotation>
  770. </xs:element>
  771. </xs:choice>
  772. <xs:attribute name="name" type="xs:string" use="optional">
  773. <xs:annotation>
  774. <xs:documentation xml:lang="en">
  775. The name of the table in the database. Propel advocates the use of singular table names.
  776. </xs:documentation>
  777. </xs:annotation>
  778. </xs:attribute>
  779. <xs:attribute name="defaultIdMethod" type="dbidmethod" default="none">
  780. <xs:annotation>
  781. <xs:documentation xml:lang="en">
  782. Default id method to use for auto-increment columns
  783. </xs:documentation>
  784. </xs:annotation>
  785. </xs:attribute>
  786. <xs:attribute name="defaultTranslateMethod" type="xs:string" use="optional"/>
  787. <xs:attribute name="defaultAccessorVisibility" type="visibility" use="optional">
  788. <xs:annotation>
  789. <xs:documentation xml:lang="en">
  790. Default visibility for column accessor methods. 'public' by default, also accepts 'protected' and 'private'.
  791. </xs:documentation>
  792. </xs:annotation>
  793. </xs:attribute>
  794. <xs:attribute name="defaultMutatorVisibility" type="visibility" use="optional">
  795. <xs:annotation>
  796. <xs:documentation xml:lang="en">
  797. Default visibility for column mutator methods. 'public' by default, also accepts 'protected' and 'private'.
  798. </xs:documentation>
  799. </xs:annotation>
  800. </xs:attribute>
  801. <xs:attribute name="package" type="php_class" use="optional">
  802. <xs:annotation>
  803. <xs:documentation xml:lang="en">
  804. Specifies the "package" for the generated classes. Classes are created in subdirectories according to the package attribute value.
  805. </xs:documentation>
  806. </xs:annotation>
  807. </xs:attribute>
  808. <xs:attribute name="namespace" type="php_namespace" use="optional">
  809. <xs:annotation>
  810. <xs:documentation xml:lang="en">
  811. The PHP 5.3 namespace to use for the generated model classes of the database. Can be overridden on a per-table basis.
  812. </xs:documentation>
  813. </xs:annotation>
  814. </xs:attribute>
  815. <xs:attribute name="schema" type="schema_name" use="optional">
  816. <xs:annotation>
  817. <xs:documentation xml:lang="en">
  818. Specify a schema for the tables in this database. Useful for RDBMs which support multiple schemas per database.
  819. </xs:documentation>
  820. </xs:annotation>
  821. </xs:attribute>
  822. <xs:attribute name="baseClass" type="php_class" use="optional">
  823. <xs:annotation>
  824. <xs:documentation xml:lang="en">
  825. Allows to specify a default base class that all generated Propel objects should extend (in place of propel.om.BaseObject)
  826. </xs:documentation>
  827. </xs:annotation>
  828. </xs:attribute>
  829. <xs:attribute name="basePeer" type="php_class" use="optional">
  830. <xs:annotation>
  831. <xs:documentation xml:lang="en">
  832. Instructs Propel to use a different SQL-generating BasePeer class (or sub-class of BasePeer) for all generated objects
  833. </xs:documentation>
  834. </xs:annotation>
  835. </xs:attribute>
  836. <xs:attribute name="defaultPhpNamingMethod" type="phpnamingmethod" default="underscore">
  837. <xs:annotation>
  838. <xs:documentation xml:lang="en">
  839. The default naming method to use in this database.
  840. </xs:documentation>
  841. </xs:annotation>
  842. </xs:attribute>
  843. <xs:attribute name="heavyIndexing" type="xs:boolean" default="false">
  844. <xs:annotation>
  845. <xs:documentation xml:lang="en">
  846. Adds indexes for each component of the primary key (when using composite primary keys)
  847. </xs:documentation>
  848. </xs:annotation>
  849. </xs:attribute>
  850. <xs:attribute name="tablePrefix" type="xs:string" use="optional">
  851. <xs:annotation>
  852. <xs:documentation xml:lang="en">
  853. Adds a prefix to all the SQL table names
  854. </xs:documentation>
  855. </xs:annotation>
  856. </xs:attribute>
  857. <xs:attribute name="defaultStringFormat" type="xs:string" use="optional">
  858. <xs:annotation>
  859. <xs:documentation xml:lang="en">
  860. The default format used to convert objects based on this database to strings. Propel supports by default the 'XML', 'YAML', 'JSON', and 'CSV' formats, but custom formats are also possible.
  861. </xs:documentation>
  862. </xs:annotation>
  863. </xs:attribute>
  864. </xs:complexType>
  865. </xs:schema>