Merge pull request #20802 from civicrm/5.39
[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>
2562d09a 7 <description>Campaigns link activities, contributions, mailings, etc. that share a programmatic goal.</description>
6a488035 8 <add>3.3</add>
449c4e6b 9 <icon>fa-bullhorn</icon>
8ab43c93 10 <labelField>title</labelField>
d31fb4e3 11 <component>CiviCampaign</component>
5c385299
CW
12 <paths>
13 <add>civicrm/campaign/add?reset=1</add>
14 <update>civicrm/campaign/add?reset=1&amp;action=update&amp;id=[id]</update>
15 <delete>civicrm/campaign/add?reset=1&amp;action=delete&amp;id=[id]</delete>
16 </paths>
6a488035 17 <field>
29e8791c
EM
18 <name>id</name>
19 <title>Campaign ID</title>
20 <type>int unsigned</type>
21 <required>true</required>
22 <comment>Unique Campaign ID.</comment>
23 <import>true</import>
0481e12c
A
24 <html>
25 <type>Number</type>
26 </html>
29e8791c 27 <add>3.3</add>
6a488035
TO
28 </field>
29 <primaryKey>
29e8791c
EM
30 <name>id</name>
31 <autoincrement>true</autoincrement>
6a488035
TO
32 </primaryKey>
33
34 <field>
29e8791c
EM
35 <name>name</name>
36 <title>Campaign Name</title>
37 <type>varchar</type>
38 <length>255</length>
39 <required>true</required>
40 <comment>Name of the Campaign.</comment>
41 <import>true</import>
42 <html>
43 <type>Text</type>
44 </html>
45 <add>3.3</add>
6a488035 46 </field>
4edfa3ea 47 <index>
48 <name>UI_campaign_name</name>
49 <fieldName>name</fieldName>
50 <add>5.34</add>
51 </index>
6a488035 52 <field>
29e8791c
EM
53 <name>title</name>
54 <title>Campaign Title</title>
55 <type>varchar</type>
56 <length>255</length>
57 <comment>Title of the Campaign.</comment>
58 <import>true</import>
59 <html>
60 <type>Text</type>
61 </html>
62 <add>3.3</add>
6a488035
TO
63 </field>
64
f813f78e 65 <field>
29e8791c
EM
66 <name>description</name>
67 <title>Campaign Description</title>
68 <type>text</type>
69 <html>
70 <type>TextArea</type>
71 <rows>8</rows>
72 <cols>60</cols>
73 </html>
74 <comment>Full description of Campaign.</comment>
75 <add>3.3</add>
f813f78e 76 </field>
6a488035
TO
77
78 <field>
29e8791c
EM
79 <name>start_date</name>
80 <title>Campaign Start Date</title>
81 <type>datetime</type>
82 <headerPattern>/^start|(s(tart\s)?date)$/i</headerPattern>
83 <comment>Date and time that Campaign starts.</comment>
84 <import>true</import>
85 <html>
86 <type>Select Date</type>
efcda6b9 87 <formatType>activityDateTime</formatType>
29e8791c
EM
88 </html>
89 <add>3.3</add>
6a488035
TO
90 </field>
91
92 <field>
29e8791c
EM
93 <name>end_date</name>
94 <title>Campaign End Date</title>
95 <type>datetime</type>
96 <headerPattern>/^end|(e(nd\s)?date)$/i</headerPattern>
97 <comment>Date and time that Campaign ends.</comment>
98 <import>true</import>
99 <html>
100 <type>Select Date</type>
efcda6b9 101 <formatType>activityDateTime</formatType>
29e8791c
EM
102 </html>
103 <add>3.3</add>
6a488035
TO
104 </field>
105
f813f78e 106 <field>
29e8791c
EM
107 <name>campaign_type_id</name>
108 <title>Campaign Type</title>
109 <type>int unsigned</type>
110 <default>NULL</default>
111 <comment>Campaign Type ID.Implicit FK to civicrm_option_value where option_group = campaign_type</comment>
112 <import>true</import>
113 <pseudoconstant>
114 <optionGroupName>campaign_type</optionGroupName>
115 </pseudoconstant>
116 <html>
117 <type>Select</type>
118 </html>
119 <add>3.3</add>
3c7d2158 120 </field>
6a488035 121 <index>
29e8791c
EM
122 <name>UI_campaign_type_id</name>
123 <fieldName>campaign_type_id</fieldName>
124 <add>3.3</add>
6a488035
TO
125 </index>
126
29e8791c
EM
127 <field>
128 <name>status_id</name>
129 <title>Campaign Status</title>
130 <type>int unsigned</type>
131 <default>NULL</default>
132 <comment>Campaign status ID.Implicit FK to civicrm_option_value where option_group = campaign_status</comment>
133 <import>true</import>
134 <pseudoconstant>
135 <optionGroupName>campaign_status</optionGroupName>
136 </pseudoconstant>
137 <html>
138 <type>Select</type>
139 </html>
140 <add>3.3</add>
6a488035
TO
141 </field>
142 <index>
29e8791c
EM
143 <name>UI_campaign_status_id</name>
144 <fieldName>status_id</fieldName>
145 <add>3.3</add>
6a488035
TO
146 </index>
147
148 <field>
29e8791c
EM
149 <name>external_identifier</name>
150 <type>varchar</type>
151 <title>Campaign External ID</title>
152 <length>32</length>
153 <headerPattern>/external\s?id/i</headerPattern>
154 <dataPattern>/^\d{11,}$/</dataPattern>
155 <comment>Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.</comment>
156 <import>true</import>
157 <add>3.3</add>
158 <html>
159 <type>Text</type>
160 </html>
6a488035
TO
161 </field>
162 <index>
29e8791c
EM
163 <name>UI_external_identifier</name>
164 <unique>true</unique>
165 <fieldName>external_identifier</fieldName>
166 <add>3.3</add>
6a488035
TO
167 </index>
168
169 <field>
29e8791c 170 <name>parent_id</name>
57e94608 171 <title>Parent Campaign ID</title>
29e8791c
EM
172 <type>int unsigned</type>
173 <default>NULL</default>
174 <comment>Optional parent id for this Campaign.</comment>
175 <import>true</import>
176 <add>3.3</add>
177 <html>
916b6181 178 <type>EntityRef</type>
57e94608 179 <label>Parent Campaign</label>
29e8791c 180 </html>
6a488035
TO
181 </field>
182 <foreignKey>
29e8791c
EM
183 <name>parent_id</name>
184 <table>civicrm_campaign</table>
185 <key>id</key>
186 <add>3.3</add>
187 <onDelete>SET NULL</onDelete>
6a488035
TO
188 </foreignKey>
189
f813f78e 190 <field>
29e8791c
EM
191 <name>is_active</name>
192 <title>Is Campaign Active?</title>
193 <type>boolean</type>
194 <default>1</default>
195 <comment>Is this Campaign enabled or disabled/cancelled?</comment>
196 <add>3.3</add>
197 <html>
198 <type>CheckBox</type>
199 </html>
f813f78e 200 </field>
6a488035
TO
201
202 <field>
29e8791c
EM
203 <name>created_id</name>
204 <type>int unsigned</type>
047c5009 205 <title>Created By Contact ID</title>
29e8791c 206 <comment>FK to civicrm_contact, who created this Campaign.</comment>
57e94608 207 <html>
047c5009 208 <label>Created By</label>
57e94608 209 </html>
29e8791c 210 <add>3.3</add>
6a488035
TO
211 </field>
212 <foreignKey>
29e8791c
EM
213 <name>created_id</name>
214 <table>civicrm_contact</table>
215 <key>id</key>
216 <add>3.3</add>
217 <onDelete>SET NULL</onDelete>
6a488035
TO
218 </foreignKey>
219
220 <field>
29e8791c
EM
221 <name>created_date</name>
222 <type>datetime</type>
223 <title>Campaign Created Date</title>
224 <comment>Date and time that Campaign was created.</comment>
225 <add>3.3</add>
226 <html>
227 <type>Select Date</type>
efcda6b9 228 <formatType>activityDateTime</formatType>
29e8791c 229 </html>
6a488035
TO
230 </field>
231
232 <field>
29e8791c
EM
233 <name>last_modified_id</name>
234 <type>int unsigned</type>
047c5009 235 <title>Modified By Contact ID</title>
29e8791c 236 <comment>FK to civicrm_contact, who recently edited this Campaign.</comment>
57e94608 237 <html>
047c5009 238 <label>Modified By</label>
57e94608 239 </html>
29e8791c 240 <add>3.3</add>
6a488035
TO
241 </field>
242 <foreignKey>
29e8791c
EM
243 <name>last_modified_id</name>
244 <table>civicrm_contact</table>
245 <key>id</key>
246 <add>3.3</add>
247 <onDelete>SET NULL</onDelete>
6a488035
TO
248 </foreignKey>
249
250 <field>
29e8791c
EM
251 <name>last_modified_date</name>
252 <type>datetime</type>
253 <title>Campaign Modified Date</title>
254 <comment>Date and time that Campaign was edited last time.</comment>
255 <add>3.3</add>
256 </field>
257 <field>
258 <name>goal_general</name>
259 <type>text</type>
260 <title>Campaign Goals</title>
261 <comment>General goals for Campaign.</comment>
262 <add>3.4</add>
263 <html>
264 <type>RichTextEditor</type>
265 </html>
266 </field>
267 <field>
268 <name>goal_revenue</name>
269 <type>decimal</type>
270 <comment>The target revenue for this campaign.</comment>
271 <add>3.4</add>
272 <html>
273 <type>Text</type>
fd735f54 274 <label>Goal Revenue</label>
29e8791c 275 </html>
6a488035
TO
276 </field>
277</table>