Merge pull request #2120 from pratik-joshi/CRM-13857
[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 <htmlType>textarea</htmlType>
52 <rows>4</rows>
53 <cols>60</cols>
54 <import>true</import>
55 <headerPattern>/Note|Comment/i</headerPattern>
56 <dataPattern>//</dataPattern>
57 <add>1.1</add>
58 </field>
59 <field>
60 <name>contact_id</name>
61 <type>int unsigned</type>
62 <comment>FK to Contact ID creator</comment>
63 <add>1.1</add>
64 </field>
65 <foreignKey>
66 <name>contact_id</name>
67 <table>civicrm_contact</table>
68 <key>id</key>
69 <add>1.1</add>
70 <onDelete>SET NULL</onDelete>
71 </foreignKey>
72 <field>
73 <name>modified_date</name>
74 <type>date</type>
75 <comment>When was this note last modified/edited</comment>
76 <add>1.1</add>
77 </field>
78 <field>
79 <name>subject</name>
80 <type>varchar</type>
81 <length>255</length>
82 <comment>subject of note description</comment>
83 <add>1.5</add>
84 </field>
85 <field>
86 <name>privacy</name>
87 <type>varchar</type>
88 <length>255</length>
89 <comment>Foreign Key to Note Privacy Level (which is an option value pair and hence an implicit FK)</comment>
90 <add>3.3</add>
91 </field>
92 </table>