Improve trigger 'scope' attribute support (RT#119997)
[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="" />
ef1e1ee6 27 <field name="email" size="500" data_type="varchar" order="4">
87c5565e 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>
b08b5416 37 <field name="another_id" size="10"
38 data_type="int" default_value="2" />
08d91aad 39 <field name="timest" size="0"
40 data_type="timestamp" order="7" >
41 </field>
87c5565e 42 </fields>
94ed484b 43
87c5565e 44 <indices>
b1789409 45 <index name="titleindex" fields="title" type="NORMAL">
46 <extra foo="bar" hello="world" bar="baz" />
47 </index>
87c5565e 48 </indices>
94ed484b 49
87c5565e 50 <constraints>
51 <constraint name="" type="PRIMARY KEY" fields="id"
52 reference_table="" options="" deferrable="1" match_type=""
b1789409 53 expression="" on_update="" on_delete="">
54 <extra foo="bar" hello="world" bar="baz" />
55 </constraint>
87c5565e 56 <constraint name="emailuniqueindex" type="UNIQUE" fields="email" />
3b9249fb 57 <constraint name="very_long_index_name_on_title_field_which_should_be_truncated_for_various_rdbms" type="UNIQUE" fields="title" />
b08b5416 58 <constraint name="" type="FOREIGN KEY" fields="another_id"
59 reference_table="Another" options="" deferrable="1" match_type=""
60 expression="" on_update="" on_delete="">
61 </constraint>
87c5565e 62 </constraints>
b1789409 63
d05e51f1 64 <extra foo="bar" hello="world" bar="baz" mysql_table_type="InnoDB" />
87c5565e 65 </table>
b08b5416 66
67 <table order="1" name="Another">
68 <fields>
69 <field
70 name="id"
71 is_primary_key="1" is_foreign_key="0"
72 size="10" data_type="int" is_auto_increment="1" order="1"
73 is_nullable="0">
74 </field>
0a0aab7b 75 <field
76 name="num"
77 size="10,2" data_type="numeric" order="2"
78 is_nullable="1">
79 </field>
b08b5416 80 </fields>
81
82 <constraints>
83 <constraint name="" type="PRIMARY KEY" fields="id"
84 reference_table="" options="" deferrable="1" match_type=""
85 expression="" on_update="" on_delete="">
86 </constraint>
87 </constraints>
88
89 <extra foo="bar" hello="world" bar="baz" mysql_table_type="InnoDB" />
90 </table>
87c5565e 91 </tables>
94ed484b 92
87c5565e 93 <views>
94 <view name="email_list" fields="email" order="1">
3910f248 95 <sql>SELECT email FROM Basic WHERE (email IS NOT NULL)</sql>
b1789409 96 <extra foo="bar" hello="world" bar="baz" />
87c5565e 97 </view>
98 </views>
94ed484b 99
87c5565e 100 <triggers>
f38b7673 101 <trigger name="foo_trigger" database_event="insert" on_table="Basic"
c0ec0e22 102 perform_action_when="after" order="1" scope="row">
87c5565e 103 <action>update modified=timestamp();</action>
b1789409 104 <extra foo="bar" hello="world" bar="baz" />
87c5565e 105 </trigger>
f38b7673 106 <trigger name="bar_trigger" database_events="insert , update" on_table="Basic"
c0ec0e22 107 perform_action_when="before" order="1" scope="row">
f38b7673 108 <action>update modified2=timestamp();</action>
109 <extra hello="aliens" />
110 </trigger>
87c5565e 111 </triggers>
94ed484b 112
87c5565e 113 <procedures>
114 <procedure name="foo_proc" order="1" owner="Nomar" parameters="foo,bar">
115 <sql>select foo from bar</sql>
116 <comments>Go Sox!</comments>
b1789409 117 <extra foo="bar" hello="world" bar="baz" />
87c5565e 118 </procedure>
119 </procedures>
94ed484b 120
121</schema>