Merge pull request #18668 from eileenmcnaughton/no_opt
[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 <add>1.1</add>
18 </field>
19 <primaryKey>
20 <name>id</name>
21 <autoincrement>true</autoincrement>
22 </primaryKey>
23 <field>
24 <name>entity_table</name>
25 <title>Note Entity</title>
26 <type>varchar</type>
27 <length>64</length>
28 <required>true</required>
29 <comment>Name of table where item being referenced is stored.</comment>
30 <pseudoconstant>
31 <callback>CRM_Core_BAO_Note::entityTables</callback>
32 </pseudoconstant>
33 <add>1.1</add>
34 </field>
35 <field>
36 <name>entity_id</name>
37 <title>Note Entity ID</title>
38 <type>int unsigned</type>
39 <required>true</required>
40 <comment>Foreign key to the referenced item.</comment>
41 <add>1.1</add>
42 </field>
43 <dynamicForeignKey>
44 <idColumn>entity_id</idColumn>
45 <typeColumn>entity_table</typeColumn>
46 <add>1.1</add>
47 </dynamicForeignKey>
48 <index>
49 <name>index_entity</name>
50 <fieldName>entity_table</fieldName>
51 <fieldName>entity_id</fieldName>
52 <add>1.1</add>
53 </index>
54 <field>
55 <name>note</name>
56 <title>Note</title>
57 <type>text</type>
58 <comment>Note and/or Comment.</comment>
59 <html>
60 <type>TextArea</type>
61 <rows>4</rows>
62 <cols>60</cols>
63 </html>
64 <import>true</import>
65 <headerPattern>/Note|Comment/i</headerPattern>
66 <dataPattern>//</dataPattern>
67 <add>1.1</add>
68 </field>
69 <field>
70 <name>contact_id</name>
71 <title>Note Created By</title>
72 <type>int unsigned</type>
73 <comment>FK to Contact ID creator</comment>
74 <add>1.1</add>
75 </field>
76 <foreignKey>
77 <name>contact_id</name>
78 <table>civicrm_contact</table>
79 <key>id</key>
80 <add>1.1</add>
81 <onDelete>SET NULL</onDelete>
82 </foreignKey>
83 <field>
84 <name>modified_date</name>
85 <title>Note Modified By</title>
86 <type>timestamp</type>
87 <comment>When was this note last modified/edited</comment>
88 <default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
89 <add>1.1</add>
90 </field>
91 <field>
92 <name>subject</name>
93 <title>Subject</title>
94 <type>varchar</type>
95 <length>255</length>
96 <comment>subject of note description</comment>
97 <html>
98 <type>Text</type>
99 <size>60</size>
100 </html>
101 <add>1.5</add>
102 </field>
103 <field>
104 <name>privacy</name>
105 <title>Privacy</title>
106 <type>varchar</type>
107 <length>255</length>
108 <comment>Foreign Key to Note Privacy Level (which is an option value pair and hence an implicit FK)</comment>
109 <add>3.3</add>
110 <html>
111 <type>Select</type>
112 </html>
113 <pseudoconstant>
114 <optionGroupName>note_privacy</optionGroupName>
115 </pseudoconstant>
116 </field>
117 </table>