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