Merge pull request #23082 from agileware/CIVICRM-1958
[civicrm-core.git] / xml / schema / Core / Discount.xml
CommitLineData
6a488035
TO
1<?xml version="1.0" encoding="iso-8859-1" ?>
2
3<table>
4 <base>CRM/Core</base>
5 <class>Discount</class>
6 <name>civicrm_discount</name>
7 <comment>Stores discounts for events on the basis of date</comment>
929a1c14 8 <add>2.1</add>
6a488035
TO
9 <log>true</log>
10 <field>
11 <name>id</name>
f3ea5182 12 <title>Discount ID</title>
6a488035
TO
13 <type>int unsigned</type>
14 <required>true</required>
15 <comment>primary key</comment>
0481e12c
A
16 <html>
17 <type>Number</type>
18 </html>
6a488035
TO
19 <add>2.1</add>
20 </field>
21 <primaryKey>
22 <name>id</name>
23 <autoincrement>true</autoincrement>
24 </primaryKey>
25 <field>
26 <name>entity_table</name>
f3ea5182 27 <title>Entity Table</title>
6a488035
TO
28 <type>varchar</type>
29 <length>64</length>
30 <comment>physical tablename for entity being joined to discount, e.g. civicrm_event</comment>
31 <add>2.1</add>
32 </field>
33 <field>
34 <name>entity_id</name>
f3ea5182 35 <title>Entity ID</title>
6a488035
TO
36 <type>int unsigned</type>
37 <required>true</required>
38 <comment>FK to entity table specified in entity_table column.</comment>
39 <add>2.1</add>
40 </field>
71e5aa5c
ARW
41 <dynamicForeignKey>
42 <idColumn>entity_id</idColumn>
43 <typeColumn>entity_table</typeColumn>
44 <add>2.1</add>
45 </dynamicForeignKey>
6a488035
TO
46 <index>
47 <name>index_entity</name>
48 <fieldName>entity_table</fieldName>
49 <fieldName>entity_id</fieldName>
50 <add>2.1</add>
51 </index>
6a488035
TO
52 <field>
53 <name>price_set_id</name>
54 <uniqueName>participant_discount_name</uniqueName>
57e94608 55 <title>Price Set ID</title>
6a488035
TO
56 <type>int unsigned</type>
57 <required>true</required>
a0fc5967
PN
58 <pseudoconstant>
59 <table>civicrm_price_set</table>
60 <keyColumn>id</keyColumn>
61 <labelColumn>title</labelColumn>
62 </pseudoconstant>
6a488035
TO
63 <export>true</export>
64 <comment>FK to civicrm_price_set</comment>
57e94608
A
65 <html>
66 <label>Price Set</label>
67 </html>
6a488035
TO
68 <add>4.3</add>
69 </field>
70 <foreignKey>
71 <name>price_set_id</name>
72 <table>civicrm_price_set</table>
73 <key>id</key>
74 <add>4.3</add>
75 <onDelete>CASCADE</onDelete>
76 </foreignKey>
77 <index>
78 <name>index_entity_option_id</name>
79 <fieldName>entity_table</fieldName>
80 <fieldName>entity_id</fieldName>
81 <fieldName>price_set_id</fieldName>
82 <add>2.1</add>
83 </index>
84 <field>
85 <name>start_date</name>
f3ea5182 86 <title>Discount Start Date</title>
6a488035
TO
87 <type>date</type>
88 <comment>Date when discount starts.</comment>
89 <add>2.1</add>
90 </field>
91 <field>
92 <name>end_date</name>
f3ea5182 93 <title>Discount End Date</title>
6a488035
TO
94 <type>date</type>
95 <comment>Date when discount ends.</comment>
96 <add>2.1</add>
97 </field>
98</table>