CRM-13497 - getting there on main tables
[civicrm-core.git] / xml / schema / Price / LineItem.xml
CommitLineData
6a488035
TO
1<?xml version="1.0" encoding="iso-8859-1" ?>
2
3<table>
4 <base>CRM/Price</base>
5 <class>LineItem</class>
6 <name>civicrm_line_item</name>
7 <add>1.7</add>
8 <log>true</log>
9 <field>
10 <name>id</name>
11 <type>int unsigned</type>
12 <required>true</required>
13 <comment>Line Item</comment>
14 <add>1.7</add>
15 </field>
16 <primaryKey>
17 <name>id</name>
18 <autoincrement>true</autoincrement>
19 </primaryKey>
20 <field>
21 <name>entity_table</name>
22 <type>varchar</type>
23 <length>64</length>
24 <required>true</required>
25 <comment>table which has the transaction</comment>
26 <add>1.7</add>
27 </field>
28 <field>
29 <name>entity_id</name>
30 <type>int unsigned</type>
31 <required>true</required>
32 <comment>entry in table</comment>
33 <add>1.7</add>
34 </field>
71e5aa5c
ARW
35 <dynamicForeignKey>
36 <idColumn>entity_id</idColumn>
37 <typeColumn>entity_table</typeColumn>
38 <add>1.7</add>
39 </dynamicForeignKey>
6a488035
TO
40 <field>
41 <name>price_field_id</name>
42 <type>int unsigned</type>
43 <comment>FK to civicrm_price_field</comment>
44 <!-- changed to not required in 4.3 in order to change ON DELETE CASCADE FK constraint to SET NULL -->
45 <add>1.7</add>
46 </field>
47 <foreignKey>
48 <name>price_field_id</name>
49 <table>civicrm_price_field</table>
50 <key>id</key>
51 <onDelete>SET NULL</onDelete>
52 </foreignKey>
53 <field>
54 <name>option_group_id</name>
55 <type>int unsigned</type>
56 <required>true</required>
57 <comment>FK to option group</comment>
58 <add>1.7</add>
59 <drop>3.3</drop>
60 </field>
61 <field>
62 <name>label</name>
63 <type>varchar</type>
64 <length>255</length>
65 <default>NULL</default>
66 <!-- changed to not required in 4.2.3 -->
67 <comment>descriptive label for item - from price_field_value.label</comment>
68 <add>1.7</add>
614d72ec 69 <html>
70 <type>Text</type>
71 </html>
6a488035
TO
72 </field>
73 <field>
74 <name>qty</name>
75 <type>int unsigned</type>
76 <required>true</required>
77 <comment>How many items ordered</comment>
78 <add>1.7</add>
614d72ec 79 <html>
80 <type>Text</type>
81 </html>
6a488035
TO
82 </field>
83 <field>
84 <name>unit_price</name>
85 <type>decimal</type>
86 <required>true</required>
87 <comment>price of each item</comment>
88 <add>1.7</add>
614d72ec 89 <html>
90 <type>Text</type>
91 </html>
6a488035
TO
92 </field>
93 <field>
94 <name>line_total</name>
95 <type>decimal</type>
96 <required>true</required>
97 <comment>qty * unit_price</comment>
98 <add>1.7</add>
99 </field>
100 <field>
101 <name>participant_count</name>
102 <type>int unsigned</type>
103 <default>NULL</default>
614d72ec 104 <comment>Participant count for fiel
105 <html>
106 <type>Text</type>
107 </html>d</comment>
6a488035 108 <add>3.2</add>
614d72ec 109
6a488035
TO
110 </field>
111 <index>
112 <name>index_entity</name>
113 <fieldName>entity_table</fieldName>
114 <fieldName>entity_id</fieldName>
115 <add>1.7</add>
116 </index>
117 <index>
118 <name>UI_line_item_value</name>
119 <fieldName>entity_table</fieldName>
120 <fieldName>entity_id</fieldName>
121 <fieldName>price_field_value_id</fieldName>
122 <fieldName>price_field_id</fieldName>
123 <unique>true</unique>
124 <add>3.3</add>
125 </index>
126 <field>
127 <name>price_field_value_id</name>
128 <type>int unsigned</type>
129 <default>NULL</default>
130 <comment>FK to civicrm_price_field_value</comment>
131 <add>3.3</add>
132 </field>
133 <foreignKey>
134 <name>price_field_value_id</name>
135 <table>civicrm_price_field_value</table>
136 <key>id</key>
137 <onDelete>SET NULL</onDelete>
138 </foreignKey>
6f3f0f22 139 <field>
140 <name>financial_type_id</name>
6a488035 141 <title>Financial Type</title>
6f3f0f22 142 <type>int unsigned</type>
6a488035
TO
143 <default>NULL</default>
144 <comment>FK to Financial Type.</comment>
6f3f0f22 145 <add>4.3</add>
614d72ec 146 <html>
147 <type>Select</type>
148 </html>
6f3f0f22 149 </field>
150 <foreignKey>
151 <name>financial_type_id</name>
152 <table>civicrm_financial_type</table>
153 <key>id</key>
6a488035
TO
154 <onDelete>SET NULL</onDelete>
155 <add>4.3</add>
6f3f0f22 156 </foreignKey>
157 <field>
158 <name>deductible_amount</name>
6a488035 159 <title>Deductible Amount</title>
6f3f0f22 160 <type>decimal</type>
6a488035
TO
161 <default>0.0</default>
162 <headerPattern>/unit?.?amoun/i</headerPattern>
163 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
6f3f0f22 164 <required>true</required>
6a488035 165 <comment>Tax-deductible portion of the amount</comment>
6f3f0f22 166 <add>4.3</add>
614d72ec 167 <html>
168 <type>Text</type>
169 </html>
6f3f0f22 170 </field>
6a488035
TO
171</table>
172