Maintain a list of core DAOs
[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>
35 <field>
36 <name>price_field_id</name>
37 <type>int unsigned</type>
38 <comment>FK to civicrm_price_field</comment>
39 <!-- changed to not required in 4.3 in order to change ON DELETE CASCADE FK constraint to SET NULL -->
40 <add>1.7</add>
41 </field>
42 <foreignKey>
43 <name>price_field_id</name>
44 <table>civicrm_price_field</table>
45 <key>id</key>
46 <onDelete>SET NULL</onDelete>
47 </foreignKey>
48 <field>
49 <name>option_group_id</name>
50 <type>int unsigned</type>
51 <required>true</required>
52 <comment>FK to option group</comment>
53 <add>1.7</add>
54 <drop>3.3</drop>
55 </field>
56 <field>
57 <name>label</name>
58 <type>varchar</type>
59 <length>255</length>
60 <default>NULL</default>
61 <!-- changed to not required in 4.2.3 -->
62 <comment>descriptive label for item - from price_field_value.label</comment>
63 <add>1.7</add>
64 </field>
65 <field>
66 <name>qty</name>
67 <type>int unsigned</type>
68 <required>true</required>
69 <comment>How many items ordered</comment>
70 <add>1.7</add>
71 </field>
72 <field>
73 <name>unit_price</name>
74 <type>decimal</type>
75 <required>true</required>
76 <comment>price of each item</comment>
77 <add>1.7</add>
78 </field>
79 <field>
80 <name>line_total</name>
81 <type>decimal</type>
82 <required>true</required>
83 <comment>qty * unit_price</comment>
84 <add>1.7</add>
85 </field>
86 <field>
87 <name>participant_count</name>
88 <type>int unsigned</type>
89 <default>NULL</default>
90 <comment>Participant count for field</comment>
91 <add>3.2</add>
92 </field>
93 <index>
94 <name>index_entity</name>
95 <fieldName>entity_table</fieldName>
96 <fieldName>entity_id</fieldName>
97 <add>1.7</add>
98 </index>
99 <index>
100 <name>UI_line_item_value</name>
101 <fieldName>entity_table</fieldName>
102 <fieldName>entity_id</fieldName>
103 <fieldName>price_field_value_id</fieldName>
104 <fieldName>price_field_id</fieldName>
105 <unique>true</unique>
106 <add>3.3</add>
107 </index>
108 <field>
109 <name>price_field_value_id</name>
110 <type>int unsigned</type>
111 <default>NULL</default>
112 <comment>FK to civicrm_price_field_value</comment>
113 <add>3.3</add>
114 </field>
115 <foreignKey>
116 <name>price_field_value_id</name>
117 <table>civicrm_price_field_value</table>
118 <key>id</key>
119 <onDelete>SET NULL</onDelete>
120 </foreignKey>
121 <field>
122 <name>financial_type_id</name>
123 <title>Financial Type</title>
124 <type>int unsigned</type>
125 <default>NULL</default>
126 <comment>FK to Financial Type.</comment>
127 <add>4.3</add>
128 </field>
129 <foreignKey>
130 <name>financial_type_id</name>
131 <table>civicrm_financial_type</table>
132 <key>id</key>
133 <onDelete>SET NULL</onDelete>
134 <add>4.3</add>
135 </foreignKey>
136 <field>
137 <name>deductible_amount</name>
138 <title>Deductible Amount</title>
139 <type>decimal</type>
140 <default>0.0</default>
141 <headerPattern>/unit?.?amoun/i</headerPattern>
142 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
143 <required>true</required>
144 <comment>Tax-deductible portion of the amount</comment>
145 <add>4.3</add>
146 </field>
147</table>
148