CRM-13497 - getting there on main tables
[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>
91 <title>Campaign Type ID</title>
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>
100 <type>Select></type>
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>
6a488035
TO
112 <title>Campaign Status ID</title>
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>
121 <type>Select></type>
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>
134 <length>32</length>
135 <headerPattern>/external\s?id/i</headerPattern>
136 <dataPattern>/^\d{11,}$/</dataPattern>
137 <comment>Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.</comment>
138 <import>true</import>
139 <add>3.3</add>
614d72ec 140 <html>
141 <type>Text</type>
142 </html>
6a488035
TO
143 </field>
144 <index>
145 <name>UI_external_identifier</name>
146 <unique>true</unique>
147 <fieldName>external_identifier</fieldName>
148 <add>3.3</add>
149 </index>
150
151 <field>
152 <name>parent_id</name>
153 <type>int unsigned</type>
154 <default>NULL</default>
155 <comment>Optional parent id for this Campaign.</comment>
156 <import>true</import>
157 <add>3.3</add>
614d72ec 158 <html>
159 <type>Autocomplete-Select</type>
160 </html>
6a488035
TO
161 </field>
162 <foreignKey>
163 <name>parent_id</name>
164 <table>civicrm_campaign</table>
165 <key>id</key>
166 <add>3.3</add>
167 <onDelete>SET NULL</onDelete>
168 </foreignKey>
169
f813f78e 170 <field>
171 <name>is_active</name>
6a488035 172 <type>boolean</type>
f813f78e 173 <default>1</default>
174 <comment>Is this Campaign enabled or disabled/cancelled?</comment>
175 <add>3.3</add>
614d72ec 176 <html>
177 <type>CheckBox</type>
178 </html>
f813f78e 179 </field>
6a488035
TO
180
181 <field>
182 <name>created_id</name>
183 <type>int unsigned</type>
184 <comment>FK to civicrm_contact, who created this Campaign.</comment>
185 <add>3.3</add>
186 </field>
187 <foreignKey>
188 <name>created_id</name>
189 <table>civicrm_contact</table>
190 <key>id</key>
191 <add>3.3</add>
192 <onDelete>SET NULL</onDelete>
193 </foreignKey>
194
195 <field>
196 <name>created_date</name>
197 <type>datetime</type>
198 <title>Campaign Created Date</title>
199 <comment>Date and time that Campaign was created.</comment>
200 <add>3.3</add>
614d72ec 201 <html>
202 <type>Select Date</type>
203 </html>
6a488035
TO
204 </field>
205
206 <field>
207 <name>last_modified_id</name>
208 <type>int unsigned</type>
209 <comment>FK to civicrm_contact, who recently edited this Campaign.</comment>
210 <add>3.3</add>
211 </field>
212 <foreignKey>
213 <name>last_modified_id</name>
214 <table>civicrm_contact</table>
215 <key>id</key>
216 <add>3.3</add>
217 <onDelete>SET NULL</onDelete>
218 </foreignKey>
219
220 <field>
221 <name>last_modified_date</name>
222 <type>datetime</type>
223 <comment>Date and time that Campaign was edited last time.</comment>
224 <add>3.3</add>
225 </field>
f813f78e 226 <field>
227 <name>goal_general</name>
228 <type>text</type>
229 <title>Campaign Goals</title>
6a488035 230 <comment>General goals for Campaign.</comment>
f813f78e 231 <add>3.4</add>
614d72ec 232 <html>
233 <type>RichTextEditor</type>
234 </html>
f813f78e 235 </field>
6a488035 236 <field>
f813f78e 237 <name>goal_revenue</name>
238 <type>decimal</type>
239 <comment>The target revenue for this campaign.</comment>
240 <add>3.4</add>
614d72ec 241 <html>
242 <type>Text</type>
243 </html>
6a488035
TO
244 </field>
245</table>