dd0ef304a5b0eb48bda02cb2f9b4eaae49897525
[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 <icon>fa-sticky-note</icon>
11 <field>
12 <name>id</name>
13 <title>Note ID</title>
14 <type>int unsigned</type>
15 <required>true</required>
16 <comment>Note ID</comment>
17 <html>
18 <type>Number</type>
19 </html>
20 <add>1.1</add>
21 </field>
22 <primaryKey>
23 <name>id</name>
24 <autoincrement>true</autoincrement>
25 </primaryKey>
26 <field>
27 <name>entity_table</name>
28 <title>Note Entity</title>
29 <type>varchar</type>
30 <length>64</length>
31 <required>true</required>
32 <comment>Name of table where item being referenced is stored.</comment>
33 <pseudoconstant>
34 <callback>CRM_Core_BAO_Note::entityTables</callback>
35 </pseudoconstant>
36 <add>1.1</add>
37 </field>
38 <field>
39 <name>entity_id</name>
40 <title>Note Entity ID</title>
41 <type>int unsigned</type>
42 <required>true</required>
43 <comment>Foreign key to the referenced item.</comment>
44 <add>1.1</add>
45 </field>
46 <dynamicForeignKey>
47 <idColumn>entity_id</idColumn>
48 <typeColumn>entity_table</typeColumn>
49 <add>1.1</add>
50 </dynamicForeignKey>
51 <index>
52 <name>index_entity</name>
53 <fieldName>entity_table</fieldName>
54 <fieldName>entity_id</fieldName>
55 <add>1.1</add>
56 </index>
57 <field>
58 <name>note</name>
59 <title>Note</title>
60 <type>text</type>
61 <comment>Note and/or Comment.</comment>
62 <html>
63 <type>TextArea</type>
64 <rows>4</rows>
65 <cols>60</cols>
66 </html>
67 <import>true</import>
68 <headerPattern>/Note|Comment/i</headerPattern>
69 <dataPattern>//</dataPattern>
70 <add>1.1</add>
71 </field>
72 <field>
73 <name>contact_id</name>
74 <title>Created By Contact ID</title>
75 <type>int unsigned</type>
76 <comment>FK to Contact ID creator</comment>
77 <html>
78 <label>Created By</label>
79 </html>
80 <add>1.1</add>
81 </field>
82 <foreignKey>
83 <name>contact_id</name>
84 <table>civicrm_contact</table>
85 <key>id</key>
86 <add>1.1</add>
87 <onDelete>SET NULL</onDelete>
88 </foreignKey>
89 <field>
90 <name>note_date</name>
91 <title>Note Date</title>
92 <type>timestamp</type>
93 <add>5.36</add>
94 <default>CURRENT_TIMESTAMP</default>
95 <comment>Date attached to the note</comment>
96 <html>
97 <type>Select Date</type>
98 <formatType>activityDateTime</formatType>
99 </html>
100 </field>
101 <field>
102 <name>created_date</name>
103 <type>timestamp</type>
104 <comment>When the note was created.</comment>
105 <required>true</required>
106 <default>CURRENT_TIMESTAMP</default>
107 <add>5.36</add>
108 </field>
109 <field>
110 <name>modified_date</name>
111 <title>Note Modified By</title>
112 <type>timestamp</type>
113 <comment>When was this note last modified/edited</comment>
114 <default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
115 <add>1.1</add>
116 <readonly>true</readonly>
117 </field>
118 <field>
119 <name>subject</name>
120 <title>Subject</title>
121 <type>varchar</type>
122 <length>255</length>
123 <comment>subject of note description</comment>
124 <html>
125 <type>Text</type>
126 <size>60</size>
127 </html>
128 <add>1.5</add>
129 </field>
130 <field>
131 <name>privacy</name>
132 <title>Privacy</title>
133 <type>varchar</type>
134 <length>255</length>
135 <comment>Foreign Key to Note Privacy Level (which is an option value pair and hence an implicit FK)</comment>
136 <add>3.3</add>
137 <html>
138 <type>Select</type>
139 </html>
140 <pseudoconstant>
141 <optionGroupName>note_privacy</optionGroupName>
142 </pseudoconstant>
143 </field>
144 </table>