Add timestamp tests, make postgres produce timestamp(0) if asked
[dbsrgits/SQL-Translator.git] / t / data / xml / schema.xml
CommitLineData
ec791002 1<?xml version="1.0" encoding="utf-8"?>
2<!--
3Created by SQL::Translator::Producer::SqlfXML
4Created on Fri Aug 15 15:08:18 2003
5
6 -->
94ed484b 7<schema xmlns="http://sqlfairy.sourceforge.net/sqlfairy.xml">
b1789409 8
87c5565e 9 <tables>
10 <table order="1" name="Basic">
11 <fields>
12 <field
13 name="id"
14 is_primary_key="1" is_foreign_key="0"
15 size="10" data_type="int" is_auto_increment="1" order="1"
16 is_nullable="0">
17 <extra ZEROFILL="1" />
18 </field>
19 <field
20 name="title"
21 is_primary_key="0" is_foreign_key="0"
22 size="100" is_auto_increment="0" data_type="varchar"
23 order="2" default_value="hello" is_nullable="0" />
24 <field
25 name="description"
26 size="0" data_type="text" order="3" default_value="" />
27 <field name="email" size="255" data_type="varchar" order="4">
28 <extra foo="bar" hello="world" bar="baz" />
29 </field>
30 <field name="explicitnulldef" size="0" data_type="varchar" order="5" />
31 <field name="explicitemptystring" size="0"
32 data_type="varchar" order="6" default_value="" />
33 <field name="emptytagdef" size="0"
34 data_type="varchar" order="7" default_value="" >
35 <comments>Hello emptytagdef</comments>
36 </field>
08d91aad 37 <field name="timest" size="0"
38 data_type="timestamp" order="7" >
39 </field>
87c5565e 40 </fields>
94ed484b 41
87c5565e 42 <indices>
b1789409 43 <index name="titleindex" fields="title" type="NORMAL">
44 <extra foo="bar" hello="world" bar="baz" />
45 </index>
87c5565e 46 </indices>
94ed484b 47
87c5565e 48 <constraints>
49 <constraint name="" type="PRIMARY KEY" fields="id"
50 reference_table="" options="" deferrable="1" match_type=""
b1789409 51 expression="" on_update="" on_delete="">
52 <extra foo="bar" hello="world" bar="baz" />
53 </constraint>
87c5565e 54 <constraint name="emailuniqueindex" type="UNIQUE" fields="email" />
55 </constraints>
b1789409 56
d05e51f1 57 <extra foo="bar" hello="world" bar="baz" mysql_table_type="InnoDB" />
87c5565e 58 </table>
59 </tables>
94ed484b 60
87c5565e 61 <views>
62 <view name="email_list" fields="email" order="1">
63 <sql>SELECT email FROM Basic WHERE email IS NOT NULL</sql>
b1789409 64 <extra foo="bar" hello="world" bar="baz" />
87c5565e 65 </view>
66 </views>
94ed484b 67
87c5565e 68 <triggers>
8ce5d615 69 <trigger name="foo_trigger" database_event="insert" on_table="Basic"
87c5565e 70 perform_action_when="after" order="1">
71 <action>update modified=timestamp();</action>
b1789409 72 <extra foo="bar" hello="world" bar="baz" />
87c5565e 73 </trigger>
74 </triggers>
94ed484b 75
87c5565e 76 <procedures>
77 <procedure name="foo_proc" order="1" owner="Nomar" parameters="foo,bar">
78 <sql>select foo from bar</sql>
79 <comments>Go Sox!</comments>
b1789409 80 <extra foo="bar" hello="world" bar="baz" />
87c5565e 81 </procedure>
82 </procedures>
94ed484b 83
84</schema>