File: pmodel_dbstruct.xml

package info (click to toggle)
libgda4 4.0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 34,928 kB
  • ctags: 18,543
  • sloc: ansic: 187,884; sh: 10,317; xml: 7,903; yacc: 3,454; makefile: 1,974; java: 1,253; python: 896; sql: 321
file content (53 lines) | stat: -rw-r--r-- 1,849 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?xml version="1.0" encoding="UTF-8"?>
<!--
   Tests databases schema
  -->


<schema>
  <!-- provider specific information 
       use <replace> to replace something with something else (context can only be "/FIELDS_A/@COLUMN_TYPE" at the moment)
       use <ignore> to ignore some parts (context can only be "/FKEY_S" or "/FIELDS_A/@COLUMN_PKEY" at the moment)
       use <symbol> to define a symbolic value
    -->
  <specifics>
    <provider name="PostgreSQL">
      <replace context="/FIELDS_A/@COLUMN_TYPE" expr="string" replace_with="varchar"/>
      <replace context="/FIELDS_A/@COLUMN_TYPE" expr="gint" replace_with="int"/>
      <symbol name="now">now()</symbol>
    </provider>

    <provider name="MySQL">
      <replace context="/FIELDS_A/@COLUMN_TYPE" expr="string" replace_with="text"/>
      <replace context="/FIELDS_A/@COLUMN_TYPE" expr="gint" replace_with="int"/>
      <ignore context="/FKEY_S"/>
      <ignore context="/FIELDS_A/@COLUMN_PKEY"/>
      <symbol name="now">CURRENT_TIMESTAMP</symbol>
    </provider>

    <provider name="SQLite">
      <replace context="/FIELDS_A/@COLUMN_TYPE" expr="gint" replace_with="integer"/>
      <symbol name="now">CURRENT_TIMESTAMP</symbol>
    </provider>
  </specifics>

  <!-- customers table -->
  <table name="customers">
    <column name="id" type="gint" pkey="TRUE" autoinc="TRUE"/>
    <column name="name"/>
    <column name="last_update" type="timestamp"/>
    <column name="default_served_by" type="gint" nullok="TRUE"/>
    <column name="country" nullok="TRUE"/>
    <column name="city" nullok="TRUE"/>
    <fkey ref_table="locations">
      <part column="country"/>
      <part column="city"/>
    </fkey>
  </table>
  
  <table name="locations">
    <column name="country" pkey="TRUE"/>
    <column name="city" pkey="TRUE"/>
    <column name="shortcut"/>
  </table>
</schema>