Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-08-04-22-25-32
[civicrm-core.git] / xml / schema / Core / Note.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Core</base>
5 <class>Note</class>
6 <name>civicrm_note</name>
7 <comment>Notes can be linked to any object in the application.</comment>
8 <add>1.1</add>
9 <log>true</log>
10 <field>
11 <name>id</name>
12 <type>int unsigned</type>
13 <required>true</required>
14 <comment>Note ID</comment>
15 <add>1.1</add>
16 </field>
17 <primaryKey>
18 <name>id</name>
19 <autoincrement>true</autoincrement>
20 </primaryKey>
21 <field>
22 <name>entity_table</name>
23 <type>varchar</type>
24 <length>64</length>
25 <required>true</required>
26 <comment>Name of table where item being referenced is stored.</comment>
27 <add>1.1</add>
28 </field>
29 <field>
30 <name>entity_id</name>
31 <type>int unsigned</type>
32 <required>true</required>
33 <comment>Foreign key to the referenced item.</comment>
34 <add>1.1</add>
35 </field>
36 <dynamicForeignKey>
37 <idColumn>entity_id</idColumn>
38 <typeColumn>entity_table</typeColumn>
39 <add>1.1</add>
40 </dynamicForeignKey>
41 <index>
42 <name>index_entity</name>
43 <fieldName>entity_table</fieldName>
44 <fieldName>entity_id</fieldName>
45 <add>1.1</add>
46 </index>
47 <field>
48 <name>note</name>
49 <type>text</type>
50 <comment>Note and/or Comment.</comment>
51 <html>
52 <type>TextArea</type>
53 <rows>4</rows>
54 <cols>60</cols>
55 </html>
56 <import>true</import>
57 <headerPattern>/Note|Comment/i</headerPattern>
58 <dataPattern>//</dataPattern>
59 <add>1.1</add>
60 </field>
61 <field>
62 <name>contact_id</name>
63 <type>int unsigned</type>
64 <comment>FK to Contact ID creator</comment>
65 <add>1.1</add>
66 </field>
67 <foreignKey>
68 <name>contact_id</name>
69 <table>civicrm_contact</table>
70 <key>id</key>
71 <add>1.1</add>
72 <onDelete>SET NULL</onDelete>
73 </foreignKey>
74 <field>
75 <name>modified_date</name>
76 <type>date</type>
77 <comment>When was this note last modified/edited</comment>
78 <add>1.1</add>
79 </field>
80 <field>
81 <name>subject</name>
82 <type>varchar</type>
83 <length>255</length>
84 <comment>subject of note description</comment>
85 <add>1.5</add>
86 </field>
87 <field>
88 <name>privacy</name>
89 <type>varchar</type>
90 <length>255</length>
91 <comment>Foreign Key to Note Privacy Level (which is an option value pair and hence an implicit FK)</comment>
92 <add>3.3</add>
93 </field>
94 </table>