Merge pull request #3066 from relldoesphp/CRM-14466
[civicrm-core.git] / xml / schema / Campaign / Campaign.xml
CommitLineData
6a488035
TO
1<?xml version="1.0" encoding="iso-8859-1" ?>
2<table>
3 <base>CRM/Campaign</base>
4 <class>Campaign</class>
5 <name>civicrm_campaign</name>
6 <comment>Campaign Details.</comment>
7 <add>3.3</add>
8
9 <field>
10 <name>id</name>
f813f78e 11 <title>Campaign ID</title>
6a488035
TO
12 <type>int unsigned</type>
13 <required>true</required>
14 <comment>Unique Campaign ID.</comment>
15 <import>true</import>
16 <add>3.3</add>
17 </field>
18 <primaryKey>
19 <name>id</name>
20 <autoincrement>true</autoincrement>
21 </primaryKey>
22
23 <field>
24 <name>name</name>
f813f78e 25 <title>Campaign Name</title>
6a488035
TO
26 <type>varchar</type>
27 <length>255</length>
28 <required>true</required>
29 <comment>Name of the Campaign.</comment>
30 <import>true</import>
7deea513 31 <html>
32 <type>Text</type>
33 </html>
6a488035
TO
34 <add>3.3</add>
35 </field>
36
37 <field>
38 <name>title</name>
39 <title>Campaign Title</title>
40 <type>varchar</type>
41 <length>255</length>
42 <comment>Title of the Campaign.</comment>
43 <import>true</import>
7deea513 44 <html>
45 <type>Text</type>
46 </html>
6a488035
TO
47 <add>3.3</add>
48 </field>
49
f813f78e 50 <field>
51 <name>description</name>
52 <title>Campaign Description</title>
53 <type>text</type>
7deea513 54 <html>
55 <type>TextArea</type>
56 <rows>8</rows>
817807ab 57 <cols>60</cols>
7deea513 58 </html>
6a488035 59 <comment>Full description of Campaign.</comment>
f813f78e 60 <add>3.3</add>
61 </field>
6a488035
TO
62
63 <field>
64 <name>start_date</name>
65 <title>Campaign Start Date</title>
66 <type>datetime</type>
67 <headerPattern>/^start|(s(tart\s)?date)$/i</headerPattern>
68 <comment>Date and time that Campaign starts.</comment>
69 <import>true</import>
7deea513 70 <html>
71 <type>Select Date</type>
72 </html>
6a488035
TO
73 <add>3.3</add>
74 </field>
75
76 <field>
77 <name>end_date</name>
78 <title>Campaign End Date</title>
79 <type>datetime</type>
80 <headerPattern>/^end|(e(nd\s)?date)$/i</headerPattern>
81 <comment>Date and time that Campaign ends.</comment>
82 <import>true</import>
7deea513 83 <html>
84 <type>Select Date</type>
85 </html>
6a488035
TO
86 <add>3.3</add>
87 </field>
88
f813f78e 89 <field>
90 <name>campaign_type_id</name>
5ce7c67c 91 <title>Campaign Type</title>
f813f78e 92 <type>int unsigned</type>
93 <default>NULL</default>
3c7d2158 94 <comment>Campaign Type ID.Implicit FK to civicrm_option_value where option_group = campaign_type</comment>
6a488035 95 <import>true</import>
3f3a3ba0
CW
96 <pseudoconstant>
97 <optionGroupName>campaign_type</optionGroupName>
98 </pseudoconstant>
614d72ec 99 <html>
e0991796 100 <type>Select</type>
614d72ec 101 </html>
3c7d2158 102 <add>3.3</add>
103 </field>
6a488035
TO
104 <index>
105 <name>UI_campaign_type_id</name>
106 <fieldName>campaign_type_id</fieldName>
107 <add>3.3</add>
108 </index>
109
f813f78e 110 <field>
111 <name>status_id</name>
5ce7c67c 112 <title>Campaign Status</title>
6a488035
TO
113 <type>int unsigned</type>
114 <default>NULL</default>
115 <comment>Campaign status ID.Implicit FK to civicrm_option_value where option_group = campaign_status</comment>
116 <import>true</import>
3f3a3ba0
CW
117 <pseudoconstant>
118 <optionGroupName>campaign_status</optionGroupName>
119 </pseudoconstant>
614d72ec 120 <html>
e0991796 121 <type>Select</type>
614d72ec 122 </html>
3c7d2158 123 <add>3.3</add>
6a488035
TO
124 </field>
125 <index>
126 <name>UI_campaign_status_id</name>
127 <fieldName>status_id</fieldName>
128 <add>3.3</add>
129 </index>
130
131 <field>
132 <name>external_identifier</name>
133 <type>varchar</type>
c669136b 134 <title>Campaign External Identifier</title>
6a488035
TO
135 <length>32</length>
136 <headerPattern>/external\s?id/i</headerPattern>
137 <dataPattern>/^\d{11,}$/</dataPattern>
138 <comment>Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.</comment>
139 <import>true</import>
140 <add>3.3</add>
614d72ec 141 <html>
142 <type>Text</type>
143 </html>
6a488035
TO
144 </field>
145 <index>
146 <name>UI_external_identifier</name>
147 <unique>true</unique>
148 <fieldName>external_identifier</fieldName>
149 <add>3.3</add>
150 </index>
151
152 <field>
153 <name>parent_id</name>
c669136b 154 <title>Parent Campaign</title>
6a488035
TO
155 <type>int unsigned</type>
156 <default>NULL</default>
157 <comment>Optional parent id for this Campaign.</comment>
158 <import>true</import>
159 <add>3.3</add>
614d72ec 160 <html>
161 <type>Autocomplete-Select</type>
162 </html>
6a488035
TO
163 </field>
164 <foreignKey>
165 <name>parent_id</name>
166 <table>civicrm_campaign</table>
167 <key>id</key>
168 <add>3.3</add>
169 <onDelete>SET NULL</onDelete>
170 </foreignKey>
171
f813f78e 172 <field>
173 <name>is_active</name>
c669136b 174 <title>Is Campaign Active?</title>
6a488035 175 <type>boolean</type>
f813f78e 176 <default>1</default>
177 <comment>Is this Campaign enabled or disabled/cancelled?</comment>
178 <add>3.3</add>
614d72ec 179 <html>
180 <type>CheckBox</type>
181 </html>
f813f78e 182 </field>
6a488035
TO
183
184 <field>
185 <name>created_id</name>
186 <type>int unsigned</type>
c669136b 187 <title>Campaign Created By</title>
6a488035
TO
188 <comment>FK to civicrm_contact, who created this Campaign.</comment>
189 <add>3.3</add>
190 </field>
191 <foreignKey>
192 <name>created_id</name>
193 <table>civicrm_contact</table>
194 <key>id</key>
195 <add>3.3</add>
196 <onDelete>SET NULL</onDelete>
197 </foreignKey>
198
199 <field>
200 <name>created_date</name>
201 <type>datetime</type>
202 <title>Campaign Created Date</title>
203 <comment>Date and time that Campaign was created.</comment>
204 <add>3.3</add>
614d72ec 205 <html>
206 <type>Select Date</type>
207 </html>
6a488035
TO
208 </field>
209
210 <field>
211 <name>last_modified_id</name>
212 <type>int unsigned</type>
c669136b 213 <title>Campaign Modified By</title>
6a488035
TO
214 <comment>FK to civicrm_contact, who recently edited this Campaign.</comment>
215 <add>3.3</add>
216 </field>
217 <foreignKey>
218 <name>last_modified_id</name>
219 <table>civicrm_contact</table>
220 <key>id</key>
221 <add>3.3</add>
222 <onDelete>SET NULL</onDelete>
223 </foreignKey>
224
225 <field>
226 <name>last_modified_date</name>
227 <type>datetime</type>
c669136b 228 <title>Campaign Modified Date</title>
6a488035
TO
229 <comment>Date and time that Campaign was edited last time.</comment>
230 <add>3.3</add>
231 </field>
f813f78e 232 <field>
233 <name>goal_general</name>
234 <type>text</type>
235 <title>Campaign Goals</title>
6a488035 236 <comment>General goals for Campaign.</comment>
f813f78e 237 <add>3.4</add>
614d72ec 238 <html>
239 <type>RichTextEditor</type>
240 </html>
f813f78e 241 </field>
6a488035 242 <field>
f813f78e 243 <name>goal_revenue</name>
244 <type>decimal</type>
245 <comment>The target revenue for this campaign.</comment>
246 <add>3.4</add>
614d72ec 247 <html>
248 <type>Text</type>
249 </html>
6a488035
TO
250 </field>
251</table>