File: pmodel_dbstruct.xml

package info (click to toggle)
libgda5 5.2.10-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 76,168 kB
  • sloc: ansic: 495,319; xml: 10,486; yacc: 5,165; sh: 4,451; makefile: 4,095; php: 1,416; java: 1,300; javascript: 1,298; python: 896; sql: 879; perl: 116
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>