Merge pull request #19086 from agileware/CIVICRM-1617
[civicrm-core.git] / xml / schema / Core / Country.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Core</base>
5 <class>Country</class>
6 <name>civicrm_country</name>
7 <add>1.1</add>
8 <field>
9 <name>id</name>
10 <title>Country ID</title>
11 <type>int unsigned</type>
12 <required>true</required>
13 <comment>Country Id</comment>
14 <add>1.1</add>
15 </field>
16 <primaryKey>
17 <name>id</name>
18 <autoincrement>true</autoincrement>
19 </primaryKey>
20 <field>
21 <name>name</name>
22 <title>Country</title>
23 <type>varchar</type>
24 <length>64</length>
25 <import>true</import>
26 <headerPattern>/country/i</headerPattern>
27 <dataPattern>/^[A-Z][a-z]+\.?(\s+[A-Z][a-z]+){0,3}$/</dataPattern>
28 <comment>Country Name</comment>
29 <add>1.1</add>
30 </field>
31 <field>
32 <name>iso_code</name>
33 <title>Country ISO Code</title>
34 <type>char</type>
35 <length>2</length>
36 <comment>ISO Code</comment>
37 <add>1.1</add>
38 </field>
39 <field>
40 <name>country_code</name>
41 <title>Country Phone Prefix</title>
42 <type>varchar</type>
43 <length>4</length>
44 <comment>National prefix to be used when dialing TO this country.</comment>
45 <add>1.1</add>
46 </field>
47 <field>
48 <name>address_format_id</name>
49 <title>Address Format</title>
50 <type>int unsigned</type>
51 <comment>Foreign key to civicrm_address_format.id.</comment>
52 <add>3.2</add>
53 </field>
54 <foreignKey>
55 <name>address_format_id</name>
56 <table>civicrm_address_format</table>
57 <key>id</key>
58 <add>3.2</add>
59 </foreignKey>
60 <field>
61 <name>idd_prefix</name>
62 <title>Outgoing Phone Prefix</title>
63 <type>varchar</type>
64 <length>4</length>
65 <comment>International direct dialing prefix from within the country TO another country</comment>
66 <add>1.1</add>
67 </field>
68 <field>
69 <name>ndd_prefix</name>
70 <title>Area Code</title>
71 <type>varchar</type>
72 <length>4</length>
73 <comment>Access prefix to call within a country to a different area</comment>
74 <add>1.1</add>
75 </field>
76 <field>
77 <name>region_id</name>
78 <title>World Region ID</title>
79 <type>int unsigned</type>
80 <required>true</required>
81 <comment>Foreign key to civicrm_worldregion.id.</comment>
82 <add>1.8</add>
83 <localize_context>country</localize_context>
84 <pseudoconstant>
85 <table>civicrm_worldregion</table>
86 <keyColumn>id</keyColumn>
87 <labelColumn>name</labelColumn>
88 </pseudoconstant>
89 </field>
90 <foreignKey>
91 <name>region_id</name>
92 <table>civicrm_worldregion</table>
93 <key>id</key>
94 <add>1.8</add>
95 </foreignKey>
96 <field>
97 <name>is_province_abbreviated</name>
98 <title>Abbreviate Province?</title>
99 <type>boolean</type>
100 <default>0</default>
101 <comment>Should state/province be displayed as abbreviation for contacts from this country?</comment>
102 <add>3.1</add>
103 </field>
104 <index>
105 <name>UI_name_iso_code</name>
106 <fieldName>name</fieldName>
107 <fieldName>iso_code</fieldName>
108 <unique>true</unique>
109 <add>1.1</add>
110 </index>
111 </table>