Merge remote-tracking branch 'upstream/4.4' into 4.4-4.5-2014-10-14-11-16-10
[civicrm-core.git] / xml / schema / Core / Note.xml
CommitLineData
6a488035
TO
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>
bf76be71
EM
11 <name>id</name>
12 <title>Note ID</title>
13 <type>int unsigned</type>
14 <required>true</required>
15 <comment>Note ID</comment>
16 <add>1.1</add>
6a488035
TO
17 </field>
18 <primaryKey>
bf76be71
EM
19 <name>id</name>
20 <autoincrement>true</autoincrement>
6a488035
TO
21 </primaryKey>
22 <field>
bf76be71
EM
23 <name>entity_table</name>
24 <title>Note Entity</title>
25 <type>varchar</type>
26 <length>64</length>
27 <required>true</required>
28 <comment>Name of table where item being referenced is stored.</comment>
29 <add>1.1</add>
6a488035
TO
30 </field>
31 <field>
bf76be71
EM
32 <name>entity_id</name>
33 <title>Note Entity ID</title>
34 <type>int unsigned</type>
35 <required>true</required>
36 <comment>Foreign key to the referenced item.</comment>
37 <add>1.1</add>
6a488035 38 </field>
71e5aa5c 39 <dynamicForeignKey>
bf76be71
EM
40 <idColumn>entity_id</idColumn>
41 <typeColumn>entity_table</typeColumn>
42 <add>1.1</add>
71e5aa5c 43 </dynamicForeignKey>
6a488035 44 <index>
bf76be71
EM
45 <name>index_entity</name>
46 <fieldName>entity_table</fieldName>
47 <fieldName>entity_id</fieldName>
48 <add>1.1</add>
6a488035
TO
49 </index>
50 <field>
bf76be71
EM
51 <name>note</name>
52 <title>Note</title>
53 <type>text</type>
54 <comment>Note and/or Comment.</comment>
55 <html>
56 <type>TextArea</type>
57 <rows>4</rows>
58 <cols>60</cols>
59 </html>
60 <import>true</import>
61 <headerPattern>/Note|Comment/i</headerPattern>
62 <dataPattern>//</dataPattern>
63 <add>1.1</add>
6a488035
TO
64 </field>
65 <field>
bf76be71
EM
66 <name>contact_id</name>
67 <title>Note Created By</title>
68 <type>int unsigned</type>
69 <comment>FK to Contact ID creator</comment>
70 <add>1.1</add>
6a488035
TO
71 </field>
72 <foreignKey>
bf76be71
EM
73 <name>contact_id</name>
74 <table>civicrm_contact</table>
75 <key>id</key>
76 <add>1.1</add>
77 <onDelete>SET NULL</onDelete>
6a488035
TO
78 </foreignKey>
79 <field>
bf76be71
EM
80 <name>modified_date</name>
81 <title>Note Modified By</title>
82 <type>date</type>
83 <comment>When was this note last modified/edited</comment>
84 <add>1.1</add>
6a488035
TO
85 </field>
86 <field>
bf76be71
EM
87 <name>subject</name>
88 <title>Subject</title>
89 <type>varchar</type>
90 <length>255</length>
91 <comment>subject of note description</comment>
92 <add>1.5</add>
6a488035
TO
93 </field>
94 <field>
bf76be71
EM
95 <name>privacy</name>
96 <title>Privacy</title>
97 <type>varchar</type>
98 <length>255</length>
99 <comment>Foreign Key to Note Privacy Level (which is an option value pair and hence an implicit FK)</comment>
100 <add>3.3</add>
6a488035
TO
101 </field>
102</table>