Guest User

JuliaKM

a guest
Mar 26th, 2008
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 236.53 KB | None | 0 0
  1. --- /Users/juliakm/Desktop/civicrm_database_schema/drupal_civicrm_civicrm.sql
  2. +++ pjournal_civicrm.sql
  3. @@ -3,14 +3,14 @@
  4. -- http://www.phpmyadmin.net
  5. --
  6. -- Host: localhost
  7. --- Generation Time: Mar 26, 2008 at 08:34 AM
  8. --- Server version: 5.0.41
  9. +-- Generation Time: Mar 26, 2008 at 08:21 AM
  10. +-- Server version: 5.0.51
  11. -- PHP Version: 5.2.5
  12.  
  13. SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
  14.  
  15. --
  16. --- Database: `drupal_civicrm_civicrm`
  17. +-- Database: `pjournal_civicrm`
  18. --
  19.  
  20. -- --------------------------------------------------------
  21. @@ -22,20 +22,20 @@
  22. CREATE TABLE `civicrm_acl` (
  23. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique table ID',
  24. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this contact',
  25. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'ACL Name.',
  26. + `name` varchar(64) default NULL COMMENT 'ACL Name.',
  27. `deny` tinyint(4) NOT NULL default '0' COMMENT 'Is this ACL entry Allow (0) or Deny (1) ?',
  28. - `entity_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Table of the object possessing this ACL entry (Contact, Group, or ACL Group)',
  29. + `entity_table` varchar(64) NOT NULL COMMENT 'Table of the object possessing this ACL entry (Contact, Group, or ACL Group)',
  30. `entity_id` int(10) unsigned default NULL COMMENT 'ID of the object possessing this ACL',
  31. - `operation` enum('All','View','Edit','Create','Delete','Grant','Revoke') collate utf8_unicode_ci NOT NULL COMMENT 'What operation does this ACL entry control?',
  32. - `object_table` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'The table of the object controlled by this ACL entry',
  33. + `operation` enum('All','View','Edit','Create','Delete','Grant','Revoke') NOT NULL COMMENT 'What operation does this ACL entry control?',
  34. + `object_table` varchar(64) default NULL COMMENT 'The table of the object controlled by this ACL entry',
  35. `object_id` int(10) unsigned default NULL COMMENT 'The ID of the object controlled by this ACL entry',
  36. - `acl_table` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'If this is a grant/revoke entry, what table are we granting?',
  37. + `acl_table` varchar(64) default NULL COMMENT 'If this is a grant/revoke entry, what table are we granting?',
  38. `acl_id` int(10) unsigned default NULL COMMENT 'ID of the ACL or ACL group being granted/revoked',
  39. `is_active` tinyint(4) default NULL COMMENT 'Is this property active?',
  40. PRIMARY KEY (`id`),
  41. KEY `index_acl_id` (`acl_id`),
  42. KEY `FK_civicrm_acl_domain_id` (`domain_id`)
  43. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
  44. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  45.  
  46. -- --------------------------------------------------------
  47.  
  48. @@ -51,7 +51,7 @@
  49. PRIMARY KEY (`id`),
  50. KEY `index_acl_id` (`acl_id`),
  51. KEY `FK_civicrm_acl_cache_contact_id` (`contact_id`)
  52. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  53. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  54.  
  55. -- --------------------------------------------------------
  56.  
  57. @@ -63,14 +63,14 @@
  58. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique table ID',
  59. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this contact',
  60. `acl_role_id` int(10) unsigned NOT NULL COMMENT 'Foreign Key to ACL Role (which is an option value pair and hence an implicit FK)',
  61. - `entity_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Table of the object joined to the ACL Role (Contact or Group)',
  62. + `entity_table` varchar(64) NOT NULL COMMENT 'Table of the object joined to the ACL Role (Contact or Group)',
  63. `entity_id` int(10) unsigned NOT NULL COMMENT 'ID of the group/contact object being joined',
  64. `is_active` tinyint(4) default NULL COMMENT 'Is this property active?',
  65. PRIMARY KEY (`id`),
  66. KEY `index_role` (`acl_role_id`),
  67. KEY `index_entity` (`entity_table`,`entity_id`),
  68. KEY `FK_civicrm_acl_entity_role_domain_id` (`domain_id`)
  69. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
  70. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  71.  
  72. -- --------------------------------------------------------
  73.  
  74. @@ -80,57 +80,49 @@
  75.  
  76. CREATE TABLE `civicrm_activity` (
  77. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Other Activity ID',
  78. - `source_contact_id` int(10) unsigned NOT NULL COMMENT 'Contact ID of the person scheduling or logging this Activity. Usually the authenticated user.',
  79. - `source_record_id` int(10) unsigned default NULL COMMENT 'Artificial FK to original transaction (e.g. contribution) IF it is not an Activity. Table can be figured out through activity_type_id, and further through component registry.',
  80. - `activity_type_id` int(10) unsigned NOT NULL default '1' COMMENT 'FK to civicrm_option_value.id, that has to be valid, registered activity type.',
  81. - `subject` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'The subject/purpose/short description of the activity.',
  82. - `activity_date_time` datetime default NULL COMMENT 'Date and time this activity is scheduled to occur. Formerly named scheduled_date_time.',
  83. - `due_date_time` datetime default NULL COMMENT 'Date and time this activity is due.',
  84. - `duration` int(10) unsigned default NULL COMMENT 'Planned or actual duration of activity expressed in minutes. Conglomerate of former duration_hours and duration_minutes.',
  85. - `location` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Location of the activity (optional, open text).',
  86. - `phone_id` int(10) unsigned default NULL COMMENT 'Phone ID of the number called (optional - used if an existing phone number is selected).',
  87. - `phone_number` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Phone number in case the number does not exist in the civicrm_phone table.',
  88. - `details` text collate utf8_unicode_ci COMMENT 'Details about the activity (agenda, notes, etc).',
  89. - `status_id` int(10) unsigned default NULL COMMENT 'ID of the status this activity is currently in. Foreign key to civicrm_option_value.',
  90. - `priority_id` int(10) unsigned default NULL COMMENT 'ID of the priority given to this activity. Foreign key to civicrm_option_value.',
  91. + `source_contact_id` int(10) unsigned NOT NULL COMMENT 'Contact ID of person scheduling or logging this Activity. This will generally an authenticated user.',
  92. + `activity_type_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to the referenced item.',
  93. + `target_entity_table` varchar(64) NOT NULL COMMENT 'Name of table where item being referenced is stored.',
  94. + `target_entity_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to the referenced item.',
  95. + `subject` varchar(64) default NULL COMMENT 'The subject/purpose of this meeting.',
  96. + `scheduled_date_time` datetime default NULL COMMENT 'Date and time meeting is scheduled to occur.',
  97. + `duration_hours` int(10) unsigned default NULL COMMENT 'Planned or actual duration of meeting - hours.',
  98. + `duration_minutes` int(10) unsigned default NULL COMMENT 'Planned or actual duration of meeting - minutes.',
  99. + `location` varchar(255) default NULL COMMENT 'Where will the meeting be held ?',
  100. + `details` text COMMENT 'Details about the meeting (agenda, notes, etc).',
  101. + `status` enum('Scheduled','Completed') default NULL COMMENT 'What is the status of this meeting? Completed meeting status results in activity history entry.',
  102. `parent_id` int(10) unsigned default NULL COMMENT 'Parent meeting ID (if this is a follow-up item). This is not currently implemented',
  103. - `is_test` tinyint(4) default '0',
  104. PRIMARY KEY (`id`),
  105. - KEY `UI_source_contact_id` (`source_contact_id`),
  106. KEY `UI_activity_type_id` (`activity_type_id`),
  107. - KEY `FK_civicrm_activity_phone_id` (`phone_id`),
  108. + KEY `FK_civicrm_activity_source_contact_id` (`source_contact_id`),
  109. KEY `FK_civicrm_activity_parent_id` (`parent_id`)
  110. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=540 ;
  111. -
  112. --- --------------------------------------------------------
  113. -
  114. ---
  115. --- Table structure for table `civicrm_activity_assignment`
  116. ---
  117. -
  118. -CREATE TABLE `civicrm_activity_assignment` (
  119. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Activity assignment id',
  120. - `activity_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to the activity for this assignment.',
  121. - `assignee_contact_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to the contact for this assignment.',
  122. - PRIMARY KEY (`id`),
  123. - KEY `UI_activity_assignee_contact_id` (`assignee_contact_id`,`activity_id`),
  124. - KEY `FK_civicrm_activity_assignment_activity_id` (`activity_id`)
  125. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=296 ;
  126. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  127.  
  128. -- --------------------------------------------------------
  129.  
  130. --
  131. --- Table structure for table `civicrm_activity_target`
  132. +-- Table structure for table `civicrm_activity_history`
  133. --
  134.  
  135. -CREATE TABLE `civicrm_activity_target` (
  136. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Activity target id',
  137. - `activity_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to the activity for this target.',
  138. - `target_contact_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to the contact for this target.',
  139. +CREATE TABLE `civicrm_activity_history` (
  140. + `id` int(10) unsigned NOT NULL auto_increment COMMENT 'table record id',
  141. + `entity_table` varchar(64) default NULL COMMENT 'physical tablename for entity whose activity history is tracked, e.g. civicrm_contact',
  142. + `entity_id` int(10) unsigned NOT NULL COMMENT 'FK to entity table specified in entity_table column',
  143. + `activity_type` varchar(64) default NULL COMMENT 'sortable label for this activity assigned be registering module or user (e.g. Phone Call)',
  144. + `module` varchar(64) default NULL COMMENT 'Display name of module which registered this activity',
  145. + `callback` varchar(64) default NULL COMMENT 'Function to call which will return URL for viewing details',
  146. + `activity_id` int(10) unsigned NOT NULL COMMENT 'FK to details item - passed to callback',
  147. + `activity_summary` varchar(255) default NULL COMMENT 'brief description of activity for summary display - as populated by registering module',
  148. + `activity_date` datetime default '0000-00-00 00:00:00' COMMENT 'when did this activity occur',
  149. + `relationship_id` int(10) unsigned default NULL COMMENT 'OPTIONAL FK to civicrm_relationship.id. Which relationship (of this contact) potentially triggered this activity, i.e. he donated because he was a Board Member of Org X / Employee of Org Y',
  150. + `group_id` int(10) unsigned default NULL COMMENT 'OPTIONAL FK to civicrm_group.id. Was this part of a group communication that triggered this activity?',
  151. + `is_test` tinyint(4) default '0',
  152. PRIMARY KEY (`id`),
  153. - KEY `UI_activity_target_contact_id` (`target_contact_id`,`activity_id`),
  154. - KEY `FK_civicrm_activity_target_activity_id` (`activity_id`)
  155. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=451 ;
  156. + KEY `index_entity` (`entity_table`,`entity_id`),
  157. + KEY `index_activity` (`activity_id`),
  158. + KEY `FK_civicrm_activity_history_relationship_id` (`relationship_id`),
  159. + KEY `FK_civicrm_activity_history_group_id` (`group_id`)
  160. +) TYPE=InnoDB AUTO_INCREMENT=104 ;
  161.  
  162. -- --------------------------------------------------------
  163.  
  164. @@ -140,91 +132,39 @@
  165.  
  166. CREATE TABLE `civicrm_address` (
  167. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Address ID',
  168. - `contact_id` int(10) unsigned default NULL COMMENT 'FK to Contact ID',
  169. - `location_type_id` int(10) unsigned default NULL COMMENT 'Which Location does this address belong to.',
  170. - `is_primary` tinyint(4) default '0' COMMENT 'Is this the primary address.',
  171. - `is_billing` tinyint(4) default '0' COMMENT 'Is this the billing address.',
  172. - `street_address` varchar(96) collate utf8_unicode_ci default NULL COMMENT 'Concatenation of all routable street address components (prefix, street number, street name, suffix, unit number OR P.O. Box). Apps should be able to determine physical location with this data (for mapping, mail delivery, etc.).',
  173. + `location_id` int(10) unsigned NOT NULL COMMENT 'Which Location does this address belong to.',
  174. + `street_address` varchar(96) default NULL COMMENT 'Concatenation of all routable street address components (prefix, street number, street name, suffix, unit number OR P.O. Box). Apps should be able to determine physical location with this data (for mapping, mail delivery, etc.).',
  175. `street_number` int(11) default NULL COMMENT 'Numeric portion of address number on the street, e.g. For 112A Main St, the street_number = 112.',
  176. - `street_number_suffix` varchar(8) collate utf8_unicode_ci default NULL COMMENT 'Non-numeric portion of address number on the street, e.g. For 112A Main St, the street_number_suffix = A',
  177. - `street_number_predirectional` varchar(8) collate utf8_unicode_ci default NULL COMMENT 'Directional prefix, e.g. SE Main St, SE is the prefix.',
  178. - `street_name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Actual street name, excluding St, Dr, Rd, Ave, e.g. For 112 Main St, the street_name = Main.',
  179. - `street_type` varchar(8) collate utf8_unicode_ci default NULL COMMENT 'St, Rd, Dr, etc.',
  180. - `street_number_postdirectional` varchar(8) collate utf8_unicode_ci default NULL COMMENT 'Directional prefix, e.g. Main St S, S is the suffix.',
  181. - `street_unit` varchar(16) collate utf8_unicode_ci default NULL COMMENT 'Secondary unit designator, e.g. Apt 3 or Unit # 14, or Bldg 1200',
  182. - `supplemental_address_1` varchar(96) collate utf8_unicode_ci default NULL COMMENT 'Supplemental Address Information, Line 1',
  183. - `supplemental_address_2` varchar(96) collate utf8_unicode_ci default NULL COMMENT 'Supplemental Address Information, Line 2',
  184. - `supplemental_address_3` varchar(96) collate utf8_unicode_ci default NULL COMMENT 'Supplemental Address Information, Line 3',
  185. - `city` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'City, Town or Village Name.',
  186. + `street_number_suffix` varchar(8) default NULL COMMENT 'Non-numeric portion of address number on the street, e.g. For 112A Main St, the street_number_suffix = A',
  187. + `street_number_predirectional` varchar(8) default NULL COMMENT 'Directional prefix, e.g. SE Main St, SE is the prefix.',
  188. + `street_name` varchar(64) default NULL COMMENT 'Actual street name, excluding St, Dr, Rd, Ave, e.g. For 112 Main St, the street_name = Main.',
  189. + `street_type` varchar(8) default NULL COMMENT 'St, Rd, Dr, etc.',
  190. + `street_number_postdirectional` varchar(8) default NULL COMMENT 'Directional prefix, e.g. Main St S, S is the suffix.',
  191. + `street_unit` varchar(16) default NULL COMMENT 'Secondary unit designator, e.g. Apt 3 or Unit # 14, or Bldg 1200',
  192. + `supplemental_address_1` varchar(96) default NULL COMMENT 'Supplemental Address Information, Line 1',
  193. + `supplemental_address_2` varchar(96) default NULL COMMENT 'Supplemental Address Information, Line 2',
  194. + `supplemental_address_3` varchar(96) default NULL COMMENT 'Supplemental Address Information, Line 3',
  195. + `city` varchar(64) default NULL COMMENT 'City, Town or Village Name.',
  196. `county_id` int(10) unsigned default NULL COMMENT 'Which County does this address belong to.',
  197. `state_province_id` int(10) unsigned default NULL COMMENT 'Which State_Province does this address belong to.',
  198. - `postal_code_suffix` varchar(12) collate utf8_unicode_ci default NULL COMMENT 'Store the suffix, like the +4 part in the USPS system.',
  199. - `postal_code` varchar(12) collate utf8_unicode_ci default NULL COMMENT 'Store both US (zip5) AND international postal codes. App is responsible for country/region appropriate validation.',
  200. - `usps_adc` varchar(32) collate utf8_unicode_ci default NULL COMMENT 'USPS Bulk mailing code.',
  201. + `postal_code_suffix` varchar(12) default NULL COMMENT 'Store the suffix, like the +4 part in the USPS system.',
  202. + `postal_code` varchar(12) default NULL COMMENT 'Store both US (zip5) AND international postal codes. App is responsible for country/region appropriate validation.',
  203. + `usps_adc` varchar(32) default NULL COMMENT 'USPS Bulk mailing code.',
  204. `country_id` int(10) unsigned default NULL COMMENT 'Which Country does this address belong to.',
  205. - `geo_code_1` double default NULL COMMENT 'Latitude',
  206. - `geo_code_2` double default NULL COMMENT 'Longitude',
  207. - `timezone` varchar(8) collate utf8_unicode_ci default NULL COMMENT 'Timezone expressed as a UTC offset - e.g. United States CST would be written as "UTC-6".',
  208. - PRIMARY KEY (`id`),
  209. - KEY `index_location_type` (`location_type_id`),
  210. - KEY `index_is_primary` (`is_primary`),
  211. - KEY `index_is_billing` (`is_billing`),
  212. + `geo_coord_id` int(10) unsigned default NULL COMMENT 'Which Geo_Coord does this address belong to.',
  213. + `geo_code_1` double default NULL COMMENT 'Latitude or UTM (Universal Transverse Mercator Grid) Northing.',
  214. + `geo_code_2` double default NULL COMMENT 'Longitude or UTM (Universal Transverse Mercator Grid) Easting.',
  215. + `timezone` varchar(8) default NULL COMMENT 'Timezone expressed as a UTC offset - e.g. United States CST would be written as "UTC-6".',
  216. + `note` varchar(255) default NULL COMMENT 'Optional misc info (e.g. delivery instructions) for this address.',
  217. + PRIMARY KEY (`id`),
  218. + UNIQUE KEY `UI_location` (`location_id`),
  219. KEY `index_street_name` (`street_name`),
  220. KEY `index_city` (`city`),
  221. - KEY `FK_civicrm_address_contact_id` (`contact_id`),
  222. KEY `FK_civicrm_address_county_id` (`county_id`),
  223. KEY `FK_civicrm_address_state_province_id` (`state_province_id`),
  224. - KEY `FK_civicrm_address_country_id` (`country_id`)
  225. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=90 ;
  226. -
  227. --- --------------------------------------------------------
  228. -
  229. ---
  230. --- Table structure for table `civicrm_case`
  231. ---
  232. -
  233. -CREATE TABLE `civicrm_case` (
  234. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Case ID',
  235. - `contact_id` int(10) unsigned NOT NULL COMMENT 'Contact ID of contact record given case belongs to.',
  236. - `case_type_id` varchar(128) collate utf8_unicode_ci NOT NULL COMMENT 'Id of first case category.',
  237. - `subject` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Short name of the case.',
  238. - `start_date` date default NULL COMMENT 'Date on which given case starts.',
  239. - `end_date` date default NULL COMMENT 'Date on which given case ends.',
  240. - `details` text collate utf8_unicode_ci COMMENT 'Details about the meeting (agenda, notes, etc).',
  241. - `status_id` int(10) unsigned NOT NULL COMMENT 'Id of case status.',
  242. - PRIMARY KEY (`id`),
  243. - KEY `index_case_type_id` (`case_type_id`),
  244. - KEY `UI_status_id` (`status_id`),
  245. - KEY `FK_civicrm_case_contact_id` (`contact_id`)
  246. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  247. -
  248. --- --------------------------------------------------------
  249. -
  250. ---
  251. --- Table structure for table `civicrm_case_activity`
  252. ---
  253. -
  254. -CREATE TABLE `civicrm_case_activity` (
  255. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique case-activity association id',
  256. - `case_id` int(10) unsigned NOT NULL COMMENT 'Case ID of case-activity association.',
  257. - `activity_id` int(10) unsigned NOT NULL COMMENT 'Activity ID of case-activity association.',
  258. - PRIMARY KEY (`id`),
  259. - KEY `UI_case_activity_id` (`case_id`,`activity_id`),
  260. - KEY `FK_civicrm_case_activity_activity_id` (`activity_id`)
  261. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  262. -
  263. --- --------------------------------------------------------
  264. -
  265. ---
  266. --- Table structure for table `civicrm_component`
  267. ---
  268. -
  269. -CREATE TABLE `civicrm_component` (
  270. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Component ID',
  271. - `name` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Name of the component.',
  272. - `namespace` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Path to components main directory in a form of a class\nnamespace.',
  273. - PRIMARY KEY (`id`)
  274. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ;
  275. + KEY `FK_civicrm_address_country_id` (`country_id`),
  276. + KEY `FK_civicrm_address_geo_coord_id` (`geo_coord_id`)
  277. +) TYPE=InnoDB AUTO_INCREMENT=243 ;
  278.  
  279. -- --------------------------------------------------------
  280.  
  281. @@ -233,62 +173,35 @@
  282. --
  283.  
  284. CREATE TABLE `civicrm_contact` (
  285. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Contact ID',
  286. + `nick_name` varchar(128) default NULL COMMENT 'Nick Name.',
  287. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this contact',
  288. - `contact_type` enum('Individual','Organization','Household') collate utf8_unicode_ci default NULL COMMENT 'Type of Contact.',
  289. - `contact_sub_type` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'May be used to over-ride contact view and edit templates.',
  290. + `contact_type` enum('Individual','Organization','Household') default NULL COMMENT 'Type of Contact.',
  291. `do_not_email` tinyint(4) default '0',
  292. `do_not_phone` tinyint(4) default '0',
  293. `do_not_mail` tinyint(4) default '0',
  294. + `contact_sub_type` varchar(64) default NULL COMMENT 'May be used to over-ride contact view and edit templates.',
  295. + `legal_identifier` varchar(32) default NULL COMMENT 'May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID.',
  296. + `external_identifier` varchar(32) default NULL COMMENT 'Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.',
  297. + `sort_name` varchar(128) default NULL COMMENT 'Name used for sorting different contact types',
  298. + `display_name` varchar(128) default NULL COMMENT 'Formatted name representing preferred format for display/print/other output.',
  299. + `home_URL` varchar(128) default NULL COMMENT 'optional "home page" URL for this contact.',
  300. + `image_URL` varchar(128) default NULL COMMENT 'optional URL for preferred image (photo, logo, etc.) to display for this contact.',
  301. + `preferred_communication_method` varchar(255) default NULL COMMENT 'What is the preferred mode of communication.',
  302. + `preferred_mail_format` enum('Text','HTML','Both') default 'Both' COMMENT 'What is the preferred mode of sending an email.',
  303. `do_not_trade` tinyint(4) default '0',
  304. + `hash` varchar(32) default NULL COMMENT 'Key for validating requests related to this contact.',
  305. `is_opt_out` tinyint(4) NOT NULL default '0' COMMENT 'Has the contact opted out from receiving all bulk email from the organization or site domain?',
  306. - `legal_identifier` varchar(32) collate utf8_unicode_ci default NULL COMMENT 'May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID.',
  307. - `external_identifier` varchar(32) collate utf8_unicode_ci default NULL COMMENT 'Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.',
  308. - `sort_name` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Name used for sorting different contact types',
  309. - `display_name` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Formatted name representing preferred format for display/print/other output.',
  310. - `nick_name` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Nick Name.',
  311. - `legal_name` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Legal Name.',
  312. - `home_URL` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'optional "home page" URL for this contact.',
  313. - `image_URL` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'optional URL for preferred image (photo, logo, etc.) to display for this contact.',
  314. - `preferred_communication_method` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'What is the preferred mode of communication.',
  315. - `preferred_mail_format` enum('Text','HTML','Both') collate utf8_unicode_ci default 'Both' COMMENT 'What is the preferred mode of sending an email.',
  316. - `hash` varchar(32) collate utf8_unicode_ci default NULL COMMENT 'Key for validating requests related to this contact.',
  317. - `source` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'where domain_id contact come from, e.g. import, donate module insert...',
  318. - `first_name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'First Name.',
  319. - `middle_name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Middle Name.',
  320. - `last_name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Last Name.',
  321. - `prefix_id` int(10) unsigned default NULL COMMENT 'Prefix or Title for name (Ms, Mr...). FK to prefix ID',
  322. - `suffix_id` int(10) unsigned default NULL COMMENT 'Suffix for name (Jr, Sr...). FK to suffix ID',
  323. - `greeting_type` enum('Formal','Informal','Honorific','Custom','Other') collate utf8_unicode_ci default NULL COMMENT 'Preferred greeting format.',
  324. - `custom_greeting` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Custom greeting message.',
  325. - `job_title` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Job Title',
  326. - `gender_id` int(10) unsigned default NULL COMMENT 'FK to gender ID',
  327. - `birth_date` date default NULL COMMENT 'Date of birth',
  328. - `is_deceased` tinyint(4) default '0',
  329. - `deceased_date` date default NULL COMMENT 'Date of deceased',
  330. - `mail_to_household_id` int(10) unsigned default NULL COMMENT 'OPTIONAL FK to civicrm_contact_household record. If NOT NULL, direct mail communications to household rather than individual location.',
  331. - `household_name` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Household Name.',
  332. - `primary_contact_id` int(10) unsigned default NULL COMMENT 'Optional FK to Primary Contact for this household.',
  333. - `organization_name` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Organization Name.',
  334. - `sic_code` varchar(8) collate utf8_unicode_ci default NULL COMMENT 'Standard Industry Classification Code.',
  335. - `user_unique_id` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM',
  336. + `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Contact ID',
  337. + `source` varchar(255) default NULL COMMENT 'where domain_id contact come from, e.g. import, donate module insert...',
  338. PRIMARY KEY (`id`),
  339. UNIQUE KEY `UI_external_identifier` (`external_identifier`),
  340. + KEY `index_sort_name_domain` (`sort_name`,`domain_id`),
  341. KEY `index_contact_type_domain` (`contact_type`,`domain_id`),
  342. KEY `index_contact_sub_type_domain` (`contact_sub_type`,`domain_id`),
  343. - KEY `index_sort_name_domain` (`sort_name`,`domain_id`),
  344. - KEY `index_preferred_communication_method` (`preferred_communication_method`),
  345. KEY `index_hash_domain` (`hash`,`domain_id`),
  346. - KEY `index_first_name` (`first_name`),
  347. - KEY `index_last_name` (`last_name`),
  348. - KEY `UI_prefix` (`prefix_id`),
  349. - KEY `UI_suffix` (`suffix_id`),
  350. - KEY `UI_gender` (`gender_id`),
  351. - KEY `index_household_name` (`household_name`),
  352. - KEY `index_organization_name` (`organization_name`),
  353. - KEY `FK_civicrm_contact_domain_id` (`domain_id`),
  354. - KEY `FK_civicrm_contact_primary_contact_id` (`primary_contact_id`)
  355. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=103 ;
  356. + KEY `index_preferred_communication_method` (`preferred_communication_method`),
  357. + KEY `FK_civicrm_contact_domain_id` (`domain_id`)
  358. +) TYPE=InnoDB AUTO_INCREMENT=324 ;
  359.  
  360. -- --------------------------------------------------------
  361.  
  362. @@ -309,20 +222,19 @@
  363. `total_amount` decimal(20,2) NOT NULL COMMENT 'Total amount of this contribution. Use market value for non-monetary gifts.',
  364. `fee_amount` decimal(20,2) default NULL COMMENT 'actual processor fee if known - may be 0.',
  365. `net_amount` decimal(20,2) default NULL COMMENT 'actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.',
  366. - `trxn_id` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method',
  367. - `invoice_id` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'unique invoice id, system generated or passed in',
  368. - `currency` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT '3 character string, value derived from payment processor config setting.',
  369. + `trxn_id` varchar(255) default NULL COMMENT 'unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method',
  370. + `invoice_id` varchar(255) default NULL COMMENT 'unique invoice id, system generated or passed in',
  371. + `currency` varchar(64) NOT NULL COMMENT '3 character string, value derived from payment processor config setting.',
  372. `cancel_date` datetime default NULL COMMENT 'when was gift cancelled',
  373. - `cancel_reason` text collate utf8_unicode_ci,
  374. + `cancel_reason` text,
  375. `receipt_date` datetime default NULL COMMENT 'when (if) receipt was sent. populated automatically for online donations w/ automatic receipting',
  376. `thankyou_date` datetime default NULL COMMENT 'when (if) was donor thanked',
  377. - `source` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Origin of this Contribution.',
  378. - `amount_level` varchar(255) collate utf8_unicode_ci default NULL,
  379. + `source` varchar(255) default NULL COMMENT 'Origin of this Contribution.',
  380. + `amount_level` varchar(255) default NULL,
  381. `contribution_recur_id` int(10) unsigned default NULL COMMENT 'Conditional foreign key to civicrm_contribution_recur id. Each contribution made in connection with a recurring contribution carries a foreign key to the recurring contribution record. This assumes we can track these processor initiated events.',
  382. `honor_contact_id` int(10) unsigned default NULL COMMENT 'FK to contact ID',
  383. `is_test` tinyint(4) default '0',
  384. `contribution_status_id` int(10) unsigned default '1',
  385. - `honor_type_id` int(10) unsigned default NULL COMMENT 'Implicit FK to civicrm_option_value.',
  386. PRIMARY KEY (`id`),
  387. UNIQUE KEY `UI_contrib_trxn_id_domain_id` (`trxn_id`,`domain_id`),
  388. UNIQUE KEY `UI_contrib_invoice_id_domain_id` (`invoice_id`,`domain_id`),
  389. @@ -336,7 +248,7 @@
  390. KEY `FK_civicrm_contribution_contribution_page_id` (`contribution_page_id`),
  391. KEY `FK_civicrm_contribution_contribution_recur_id` (`contribution_recur_id`),
  392. KEY `FK_civicrm_contribution_honor_contact_id` (`honor_contact_id`)
  393. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=10 ;
  394. +) TYPE=InnoDB AUTO_INCREMENT=43 ;
  395.  
  396. -- --------------------------------------------------------
  397.  
  398. @@ -347,43 +259,42 @@
  399. CREATE TABLE `civicrm_contribution_page` (
  400. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Contribution Id',
  401. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this page',
  402. - `title` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Contribution Page title. For top of page display',
  403. - `intro_text` text collate utf8_unicode_ci COMMENT 'Text and html allowed. Displayed below title.',
  404. + `title` varchar(255) default NULL COMMENT 'Contribution Page title. For top of page display',
  405. + `intro_text` text COMMENT 'Text and html allowed. Displayed below title.',
  406. `contribution_type_id` int(10) unsigned NOT NULL COMMENT 'default Contribution type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution',
  407. `payment_processor_id` int(10) unsigned default NULL COMMENT 'Payment Processor for this contribution Page ',
  408. `is_credit_card_only` tinyint(4) default '0' COMMENT 'if true - processing logic must reject transaction at confirmation stage if pay method != credit card',
  409. `is_monetary` tinyint(4) default '1' COMMENT 'if true - allows real-time monetary transactions otherwise non-monetary transactions',
  410. `is_recur` tinyint(4) default '0' COMMENT 'if true - allows recurring contributions, valid only for PayPal_Standard',
  411. - `is_pay_later` tinyint(4) default '0' COMMENT 'if true - allows the user to send payment directly to the org later',
  412. - `pay_later_text` text collate utf8_unicode_ci COMMENT 'The text displayed to the user in the main form',
  413. - `pay_later_receipt` text collate utf8_unicode_ci COMMENT 'The receipt sent to the user instead of the normal receipt text',
  414. `is_allow_other_amount` tinyint(4) default '0' COMMENT 'if true, page will include an input text field where user can enter their own amount',
  415. - `default_amount_id` int(10) unsigned default NULL COMMENT 'FK to civicrm_option_value.',
  416. + `default_amount_id` int(10) unsigned default NULL COMMENT 'FK to civicrm_custom_option.',
  417. `min_amount` decimal(20,2) default NULL COMMENT 'if other amounts allowed, user can configure minimum allowed.',
  418. `max_amount` decimal(20,2) default NULL COMMENT 'if other amounts allowed, user can configure maximum allowed.',
  419. `goal_amount` decimal(20,2) default NULL COMMENT 'The target goal for this page, allows people to build a goal meter',
  420. - `thankyou_title` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Title for Thank-you page (header title tag, and display at the top of the page).',
  421. - `thankyou_text` text collate utf8_unicode_ci COMMENT 'text and html allowed. displayed above result on success page',
  422. - `thankyou_footer` text collate utf8_unicode_ci COMMENT 'Text and html allowed. displayed at the bottom of the success page. Common usage is to include link(s) to other pages such as tell-a-friend, etc.',
  423. + `thankyou_title` varchar(255) default NULL COMMENT 'Title for Thank-you page (header title tag, and display at the top of the page).',
  424. + `thankyou_text` text COMMENT 'text and html allowed. displayed above result on success page',
  425. + `thankyou_footer` text COMMENT 'Text and html allowed. displayed at the bottom of the success page. Common usage is to include link(s) to other pages such as tell-a-friend, etc.',
  426. `is_email_receipt` tinyint(4) default '1' COMMENT 'if true, receipt is automatically emailed to contact on success',
  427. - `receipt_from_name` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'FROM email name used for receipts generated by contributions to this contribution page.',
  428. - `receipt_from_email` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'FROM email address used for receipts generated by contributions to this contribution page.',
  429. - `cc_receipt` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'comma-separated list of email addresses to cc each time a receipt is sent',
  430. - `bcc_receipt` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'comma-separated list of email addresses to bcc each time a receipt is sent',
  431. - `receipt_text` text collate utf8_unicode_ci COMMENT 'text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now',
  432. + `receipt_from_name` varchar(255) default NULL COMMENT 'FROM email name used for receipts generated by contributions to this contribution page.',
  433. + `receipt_from_email` varchar(255) default NULL COMMENT 'FROM email address used for receipts generated by contributions to this contribution page.',
  434. + `cc_receipt` varchar(255) default NULL COMMENT 'comma-separated list of email addresses to cc each time a receipt is sent',
  435. + `bcc_receipt` varchar(255) default NULL COMMENT 'comma-separated list of email addresses to bcc each time a receipt is sent',
  436. + `receipt_text` text COMMENT 'text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now',
  437. `is_active` tinyint(4) default NULL COMMENT 'Is this property active?',
  438. - `footer_text` text collate utf8_unicode_ci COMMENT 'Text and html allowed. Displayed at the bottom of the first page of the contribution wizard.',
  439. + `footer_text` text COMMENT 'Text and html allowed. Displayed at the bottom of the first page of the contribution wizard.',
  440. `amount_block_is_active` tinyint(4) default '1' COMMENT 'Is this property active?',
  441. + `is_thermometer` tinyint(4) default NULL COMMENT 'Should this contribution have the thermometer block enabled?',
  442. + `thermometer_title` varchar(255) default NULL COMMENT 'Title for thermometer block.',
  443. `honor_block_is_active` tinyint(4) default NULL COMMENT 'Should this contribution have the honor block enabled?',
  444. - `honor_block_title` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Title for honor block.',
  445. - `honor_block_text` text collate utf8_unicode_ci COMMENT 'text for honor block.',
  446. + `honor_block_title` varchar(255) default NULL COMMENT 'Title for honor block.',
  447. + `honor_block_text` text COMMENT 'text for honor block.',
  448. `start_date` datetime default NULL COMMENT 'Date and time that this page starts.',
  449. `end_date` datetime default NULL COMMENT 'Date and time that this page ends. May be NULL if no defined end date/time',
  450. PRIMARY KEY (`id`),
  451. KEY `FK_civicrm_contribution_page_domain_id` (`domain_id`),
  452. KEY `FK_civicrm_contribution_page_contribution_type_id` (`contribution_type_id`),
  453. KEY `FK_civicrm_contribution_page_payment_processor_id` (`payment_processor_id`)
  454. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;
  455. +) TYPE=InnoDB AUTO_INCREMENT=2 ;
  456.  
  457. -- --------------------------------------------------------
  458.  
  459. @@ -395,15 +306,15 @@
  460. `id` int(10) unsigned NOT NULL auto_increment,
  461. `product_id` int(10) unsigned NOT NULL,
  462. `contribution_id` int(10) unsigned NOT NULL,
  463. - `product_option` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Option value selected if applicable - e.g. color, size etc.',
  464. + `product_option` varchar(255) default NULL COMMENT 'Option value selected if applicable - e.g. color, size etc.',
  465. `quantity` int(11) default NULL,
  466. `fulfilled_date` date default NULL COMMENT 'Optional. Can be used to record the date this product was fulfilled or shipped.',
  467. `start_date` date default NULL COMMENT 'Actual start date for a time-delimited premium (subscription, service or membership)',
  468. `end_date` date default NULL COMMENT 'Actual end date for a time-delimited premium (subscription, service or membership)',
  469. - `comment` text collate utf8_unicode_ci,
  470. + `comment` text,
  471. PRIMARY KEY (`id`),
  472. KEY `FK_civicrm_contribution_product_contribution_id` (`contribution_id`)
  473. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  474. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  475.  
  476. -- --------------------------------------------------------
  477.  
  478. @@ -416,7 +327,7 @@
  479. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this contribution class.',
  480. `contact_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to civicrm_contact.id .',
  481. `amount` decimal(20,2) NOT NULL COMMENT 'Amount to be contributed or charged each recurrence.',
  482. - `frequency_unit` enum('day','week','month','year') collate utf8_unicode_ci default 'month' COMMENT 'Time units for recurrence of payment.',
  483. + `frequency_unit` enum('day','week','month','year') default 'month' COMMENT 'Time units for recurrence of payment.',
  484. `frequency_interval` int(10) unsigned NOT NULL COMMENT 'Number of time units for recurrence of payment.',
  485. `installments` int(10) unsigned default NULL COMMENT 'Total number of payments to be made. Set this to 0 if this is an open-ended commitment i.e. no set end date.',
  486. `start_date` datetime NOT NULL COMMENT 'The date the first scheduled recurring contribution occurs.',
  487. @@ -424,9 +335,9 @@
  488. `modified_date` datetime NOT NULL COMMENT 'Last updated date for this record. mostly the last time a payment was received',
  489. `cancel_date` datetime NOT NULL COMMENT 'Date this recurring contribution was cancelled by contributor- if we can get access to it',
  490. `end_date` datetime NOT NULL COMMENT 'Date this recurring contribution finished successfully',
  491. - `processor_id` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor??',
  492. - `trxn_id` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method',
  493. - `invoice_id` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'unique invoice id, system generated or passed in',
  494. + `processor_id` varchar(255) default NULL COMMENT 'Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor??',
  495. + `trxn_id` varchar(255) default NULL COMMENT 'unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method',
  496. + `invoice_id` varchar(255) default NULL COMMENT 'unique invoice id, system generated or passed in',
  497. `contribution_status_id` int(10) unsigned default '1',
  498. `is_test` tinyint(4) default '0',
  499. `cycle_day` int(10) unsigned NOT NULL default '1' COMMENT 'Day in the period when the payment should be charged e.g. 1st of month, 15th etc.',
  500. @@ -440,7 +351,7 @@
  501. KEY `index_contribution_status` (`contribution_status_id`),
  502. KEY `FK_civicrm_contribution_recur_domain_id` (`domain_id`),
  503. KEY `FK_civicrm_contribution_recur_contact_id` (`contact_id`)
  504. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  505. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  506.  
  507. -- --------------------------------------------------------
  508.  
  509. @@ -451,44 +362,16 @@
  510. CREATE TABLE `civicrm_contribution_type` (
  511. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Contribution Type ID',
  512. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this contribution type.',
  513. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Contribution Type Name.',
  514. - `accounting_code` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Optional value for mapping contributions to accounting system codes for each type/category of contribution.',
  515. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Contribution Type Description.',
  516. + `name` varchar(64) default NULL COMMENT 'Contribution Type Name.',
  517. + `accounting_code` varchar(64) default NULL COMMENT 'Optional value for mapping contributions to accounting system codes for each type/category of contribution.',
  518. + `description` varchar(255) default NULL COMMENT 'Contribution Type Description.',
  519. `is_deductible` tinyint(4) default '1' COMMENT 'Is this contribution type tax-deductible? If true, contributions of this type may be fully OR partially deductible - non-deductible amount is stored in the Contribution record.',
  520. `is_reserved` tinyint(4) default NULL COMMENT 'Is this a predefined system object?',
  521. `is_active` tinyint(4) default NULL COMMENT 'Is this property active?',
  522. PRIMARY KEY (`id`),
  523. UNIQUE KEY `UI_name_domain_id` (`name`,`domain_id`),
  524. KEY `FK_civicrm_contribution_type_domain_id` (`domain_id`)
  525. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ;
  526. -
  527. --- --------------------------------------------------------
  528. -
  529. ---
  530. --- Table structure for table `civicrm_contribution_widget`
  531. ---
  532. -
  533. -CREATE TABLE `civicrm_contribution_widget` (
  534. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Contribution Id',
  535. - `contribution_page_id` int(10) unsigned default NULL COMMENT 'The Contribution Page which triggered this contribution',
  536. - `is_active` tinyint(4) default NULL COMMENT 'Is this property active?',
  537. - `title` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Widget title.',
  538. - `url_logo` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'URL to Widget logo',
  539. - `button_title` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Button title.',
  540. - `about` text collate utf8_unicode_ci COMMENT 'About description.',
  541. - `url_homepage` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'URL to Homepage.',
  542. - `color_title` varchar(10) collate utf8_unicode_ci default NULL,
  543. - `color_button` varchar(10) collate utf8_unicode_ci default NULL,
  544. - `color_bar` varchar(10) collate utf8_unicode_ci default NULL,
  545. - `color_main_text` varchar(10) collate utf8_unicode_ci default NULL,
  546. - `color_main` varchar(10) collate utf8_unicode_ci default NULL,
  547. - `color_main_bg` varchar(10) collate utf8_unicode_ci default NULL,
  548. - `color_bg` varchar(10) collate utf8_unicode_ci default NULL,
  549. - `color_about_link` varchar(10) collate utf8_unicode_ci default NULL,
  550. - `color_homepage_link` varchar(10) collate utf8_unicode_ci default NULL,
  551. - PRIMARY KEY (`id`),
  552. - KEY `FK_civicrm_contribution_widget_contribution_page_id` (`contribution_page_id`)
  553. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  554. +) TYPE=InnoDB AUTO_INCREMENT=5 ;
  555.  
  556. -- --------------------------------------------------------
  557.  
  558. @@ -498,16 +381,14 @@
  559.  
  560. CREATE TABLE `civicrm_country` (
  561. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Country Id',
  562. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Country Name',
  563. - `iso_code` char(2) collate utf8_unicode_ci default NULL COMMENT 'ISO Code',
  564. - `country_code` varchar(4) collate utf8_unicode_ci default NULL COMMENT 'National prefix to be used when dialing TO this country.',
  565. - `idd_prefix` varchar(4) collate utf8_unicode_ci default NULL COMMENT 'International direct dialing prefix from within the country TO another country',
  566. - `ndd_prefix` varchar(4) collate utf8_unicode_ci default NULL COMMENT 'Access prefix to call within a country to a different area',
  567. - `region_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to civicrm_worldregion.id.',
  568. - PRIMARY KEY (`id`),
  569. - UNIQUE KEY `UI_name_iso_code` (`name`,`iso_code`),
  570. - KEY `FK_civicrm_country_region_id` (`region_id`)
  571. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1247 ;
  572. + `name` varchar(64) default NULL COMMENT 'Country Name',
  573. + `iso_code` char(2) default NULL COMMENT 'ISO Code',
  574. + `country_code` varchar(4) default NULL COMMENT 'National prefix to be used when dialing TO this country.',
  575. + `idd_prefix` varchar(4) default NULL COMMENT 'International direct dialing prefix from within the country TO another country',
  576. + `ndd_prefix` varchar(4) default NULL COMMENT 'Access prefix to call within a country to a different area',
  577. + PRIMARY KEY (`id`),
  578. + UNIQUE KEY `UI_name_iso_code` (`name`,`iso_code`)
  579. +) TYPE=InnoDB AUTO_INCREMENT=1247 ;
  580.  
  581. -- --------------------------------------------------------
  582.  
  583. @@ -517,13 +398,13 @@
  584.  
  585. CREATE TABLE `civicrm_county` (
  586. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'County ID',
  587. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Name of County',
  588. - `abbreviation` varchar(4) collate utf8_unicode_ci default NULL COMMENT '2-4 Character Abbreviation of County',
  589. + `name` varchar(64) default NULL COMMENT 'Name of County',
  590. + `abbreviation` varchar(4) default NULL COMMENT '2-4 Character Abbreviation of County',
  591. `state_province_id` int(10) unsigned NOT NULL COMMENT 'ID of State / Province that County belongs',
  592. PRIMARY KEY (`id`),
  593. UNIQUE KEY `UI_name_state_id` (`name`,`state_province_id`),
  594. KEY `FK_civicrm_county_state_province_id` (`state_province_id`)
  595. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ;
  596. +) TYPE=InnoDB AUTO_INCREMENT=7 ;
  597.  
  598. -- --------------------------------------------------------
  599.  
  600. @@ -533,12 +414,12 @@
  601.  
  602. CREATE TABLE `civicrm_currency` (
  603. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Currency Id',
  604. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Currency Name',
  605. - `symbol` varchar(8) collate utf8_unicode_ci default NULL COMMENT 'Currency Symbol',
  606. - `numeric_code` varchar(3) collate utf8_unicode_ci default NULL COMMENT 'Numeric currency code',
  607. - `full_name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Full currency name',
  608. + `name` varchar(64) default NULL COMMENT 'Currency Name',
  609. + `symbol` varchar(8) default NULL COMMENT 'Currency Symbol',
  610. + `numeric_code` varchar(3) default NULL COMMENT 'Numeric currency code',
  611. + `full_name` varchar(64) default NULL COMMENT 'Full currency name',
  612. PRIMARY KEY (`id`)
  613. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=186 ;
  614. +) TYPE=InnoDB AUTO_INCREMENT=186 ;
  615.  
  616. -- --------------------------------------------------------
  617.  
  618. @@ -549,32 +430,33 @@
  619. CREATE TABLE `civicrm_custom_field` (
  620. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Custom Field ID',
  621. `custom_group_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_custom_group.',
  622. - `label` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Text for form field label (also friendly name for administering this custom property).',
  623. - `data_type` enum('String','Int','Float','Money','Memo','Date','Boolean','StateProvince','Country','File','Link') collate utf8_unicode_ci NOT NULL COMMENT 'Controls location of data storage in extended_data table.',
  624. - `html_type` enum('Text','TextArea','Select','Multi-Select','Radio','CheckBox','Select Date','Select State/Province','Select Country','File','Link') collate utf8_unicode_ci NOT NULL COMMENT 'HTML types plus several built-in extended types.',
  625. - `default_value` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Use form_options.is_default for field_types which use options.',
  626. + `name` varchar(64) default NULL COMMENT 'Variable name/programmatic handle for this property.',
  627. + `label` varchar(64) default NULL COMMENT 'Text for form field label (also friendly name for administering this custom property).',
  628. + `data_type` enum('String','Int','Float','Money','Memo','Date','Boolean','StateProvince','Country','File','Link') default NULL COMMENT 'Controls location of data storage in extended_data table.',
  629. + `html_type` enum('Text','TextArea','Select','Multi-Select','Radio','CheckBox','Select Date','Select State/Province','Select Country','File','Link') default NULL COMMENT 'HTML types plus several built-in extended types.',
  630. + `default_value` varchar(255) default NULL COMMENT 'Use form_options.is_default for field_types which use options.',
  631. `is_required` tinyint(4) default NULL COMMENT 'Is a value required for this property.',
  632. `is_searchable` tinyint(4) default NULL COMMENT 'Is this property searchable.',
  633. `is_search_range` tinyint(4) default '0' COMMENT 'Is this property range searchable.',
  634. `weight` int(11) NOT NULL default '1' COMMENT 'Controls field display order within an extended property group.',
  635. - `help_pre` text collate utf8_unicode_ci COMMENT 'Description and/or help text to display before this field.',
  636. - `help_post` text collate utf8_unicode_ci COMMENT 'Description and/or help text to display after this field.',
  637. - `mask` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Optional format instructions for specific field types, like date types.',
  638. - `attributes` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Store collection of type-appropriate attributes, e.g. textarea needs rows/cols attributes',
  639. - `javascript` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Optional scripting attributes for field.',
  640. + `validation_id` int(10) unsigned default NULL COMMENT 'FK to civicrm_validation. Will be used for custom validation functions.',
  641. + `help_pre` text COMMENT 'Description and/or help text to display before this field.',
  642. + `help_post` text COMMENT 'Description and/or help text to display after this field.',
  643. + `mask` varchar(64) default NULL COMMENT 'Optional format instructions for specific field types, like date types.',
  644. + `attributes` varchar(255) default NULL COMMENT 'Store collection of type-appropriate attributes, e.g. textarea needs rows/cols attributes',
  645. + `javascript` varchar(255) default NULL COMMENT 'Optional scripting attributes for field.',
  646. `is_active` tinyint(4) default NULL COMMENT 'Is this property active?',
  647. `options_per_line` int(10) unsigned default NULL COMMENT 'number of options per line for checkbox and radio',
  648. `start_date_years` int(10) unsigned default NULL COMMENT 'Date may be up to start_date_years years prior to tcurrent date ',
  649. `end_date_years` int(10) unsigned default NULL COMMENT 'Date may be up to end_date_years years after to tcurrent date ',
  650. - `date_parts` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'which date part included in display ',
  651. + `date_parts` varchar(255) default NULL COMMENT 'which date part included in display ',
  652. `note_columns` int(10) unsigned default NULL COMMENT ' Number of columns in Note Field ',
  653. `note_rows` int(10) unsigned default NULL COMMENT ' Number of rows in Note Field ',
  654. - `column_name` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Name of the column that holds the values for this field.',
  655. - `option_group_id` int(10) unsigned default NULL COMMENT 'For elements with options, the option group id that is used',
  656. PRIMARY KEY (`id`),
  657. UNIQUE KEY `UI_label_custom_group_id` (`label`,`custom_group_id`),
  658. - KEY `FK_civicrm_custom_field_custom_group_id` (`custom_group_id`)
  659. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;
  660. + KEY `FK_civicrm_custom_field_custom_group_id` (`custom_group_id`),
  661. + KEY `FK_civicrm_custom_field_validation_id` (`validation_id`)
  662. +) TYPE=InnoDB AUTO_INCREMENT=7 ;
  663.  
  664. -- --------------------------------------------------------
  665.  
  666. @@ -585,24 +467,69 @@
  667. CREATE TABLE `civicrm_custom_group` (
  668. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Custom Group ID',
  669. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this contact',
  670. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Variable name/programmatic handle for this group.',
  671. - `title` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Friendly Name.',
  672. - `extends` enum('Contact','Individual','Household','Organization','Location','Address','Contribution','Activity','Relationship','Group','Membership','Participant','Event','Grant') collate utf8_unicode_ci default 'Contact' COMMENT 'Type of object this group extends (can add other options later e.g. contact_address, etc.).',
  673. - `extends_entity_column_name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'linking custom group for dynamic object',
  674. - `extends_entity_column_value` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'linking custom group for dynamic object',
  675. - `style` enum('Tab','Inline') collate utf8_unicode_ci default NULL COMMENT 'Visual relationship between this form and its parent.',
  676. + `name` varchar(64) default NULL COMMENT 'Variable name/programmatic handle for this group.',
  677. + `title` varchar(64) default NULL COMMENT 'Friendly Name.',
  678. + `extends` enum('Contact','Individual','Household','Organization','Location','Address','Contribution','Activity','Relationship','Phonecall','Meeting','Group','Membership','Participant','Event') default 'Contact' COMMENT 'Type of object this group extends (can add other options later e.g. contact_address, etc.).',
  679. + `extends_entity_column_name` varchar(64) default NULL COMMENT 'linking custom group for dynamic object',
  680. + `extends_entity_column_value` varchar(64) default NULL COMMENT 'linking custom group for dynamic object',
  681. + `style` enum('Tab','Inline') default NULL COMMENT 'Visual relationship between this form and its parent.',
  682. `collapse_display` int(10) unsigned default '0' COMMENT 'Will this group be in collapsed or expanded mode on initial display ?',
  683. - `help_pre` text collate utf8_unicode_ci COMMENT 'Description and/or help text to display before fields in form.',
  684. - `help_post` text collate utf8_unicode_ci COMMENT 'Description and/or help text to display after fields in form.',
  685. + `help_pre` text COMMENT 'Description and/or help text to display before fields in form.',
  686. + `help_post` text COMMENT 'Description and/or help text to display after fields in form.',
  687. `weight` int(11) NOT NULL default '1' COMMENT 'Controls display order when multiple extended property groups are setup for the same class.',
  688. `is_active` tinyint(4) default NULL COMMENT 'Is this property active?',
  689. - `table_name` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Name of the table that holds the values for this group.',
  690. - `is_multiple` tinyint(4) default NULL COMMENT 'Does this group hold multiple values?',
  691. PRIMARY KEY (`id`),
  692. UNIQUE KEY `UI_title_domain_id` (`title`,`domain_id`),
  693. UNIQUE KEY `UI_name_domain_id` (`name`,`domain_id`),
  694. KEY `FK_civicrm_custom_group_domain_id` (`domain_id`)
  695. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
  696. +) TYPE=InnoDB AUTO_INCREMENT=3 ;
  697. +
  698. +-- --------------------------------------------------------
  699. +
  700. +--
  701. +-- Table structure for table `civicrm_custom_option`
  702. +--
  703. +
  704. +CREATE TABLE `civicrm_custom_option` (
  705. + `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Custom Option ID',
  706. + `entity_table` varchar(64) NOT NULL COMMENT 'Name of table where item being referenced is stored.',
  707. + `entity_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to the referenced item.',
  708. + `label` varchar(64) default NULL COMMENT 'Label for option',
  709. + `value` varchar(64) default NULL COMMENT 'Value of the option (when form is submitted)',
  710. + `weight` int(11) NOT NULL default '1' COMMENT 'Order in which the options are displayed',
  711. + `is_active` tinyint(4) default NULL COMMENT 'Is this option active ?',
  712. + PRIMARY KEY (`id`),
  713. + KEY `index_entity` (`entity_table`,`entity_id`)
  714. +) TYPE=InnoDB AUTO_INCREMENT=40 ;
  715. +
  716. +-- --------------------------------------------------------
  717. +
  718. +--
  719. +-- Table structure for table `civicrm_custom_value`
  720. +--
  721. +
  722. +CREATE TABLE `civicrm_custom_value` (
  723. + `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID',
  724. + `custom_field_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to civicrm_ext_property.',
  725. + `entity_table` varchar(64) default NULL COMMENT 'physical tablename for entity being extended by this data, e.g. civicrm_contact',
  726. + `entity_id` int(10) unsigned NOT NULL COMMENT 'FK to record in the entity table specified by entity_table column.',
  727. + `int_data` int(11) default NULL COMMENT 'stores data for ext property data_type = integer. This col supports signed integers.',
  728. + `float_data` double default NULL COMMENT 'stores data for ext property data_type = float.',
  729. + `decimal_data` decimal(20,2) default NULL COMMENT 'stores data for ext property data_type = money.',
  730. + `char_data` varchar(255) default NULL COMMENT 'data for ext property data_type = text.',
  731. + `date_data` date default NULL COMMENT 'data for ext property data_type = date.',
  732. + `memo_data` text COMMENT 'data for ext property data_type = memo.',
  733. + `file_id` int(10) unsigned default NULL COMMENT 'FK to civicrm_file',
  734. + PRIMARY KEY (`id`),
  735. + KEY `index_entity` (`entity_table`,`entity_id`),
  736. + KEY `index_int_field` (`int_data`,`custom_field_id`),
  737. + KEY `index_float_field` (`float_data`,`custom_field_id`),
  738. + KEY `index_decimal_field` (`decimal_data`,`custom_field_id`),
  739. + KEY `index_char_field` (`char_data`,`custom_field_id`),
  740. + KEY `index_date_field` (`date_data`,`custom_field_id`),
  741. + KEY `FK_civicrm_custom_value_custom_field_id` (`custom_field_id`),
  742. + KEY `FK_civicrm_custom_value_file_id` (`file_id`)
  743. +) TYPE=InnoDB AUTO_INCREMENT=43 ;
  744.  
  745. -- --------------------------------------------------------
  746.  
  747. @@ -613,13 +540,13 @@
  748. CREATE TABLE `civicrm_dedupe_rule` (
  749. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique dedupe rule id',
  750. `dedupe_rule_group_id` int(10) unsigned NOT NULL COMMENT 'The id of the rule group this rule belongs to',
  751. - `rule_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'The name of the table this rule is about',
  752. - `rule_field` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'The name of the field of the table referenced in rule_table',
  753. + `rule_table` varchar(64) NOT NULL COMMENT 'The name of the table this rule is about',
  754. + `rule_field` varchar(64) NOT NULL COMMENT 'The name of the field of the table referenced in rule_table',
  755. `rule_length` int(10) unsigned default NULL COMMENT 'The lenght of the matching substring',
  756. `rule_weight` int(11) NOT NULL COMMENT 'The weight of the rule',
  757. PRIMARY KEY (`id`),
  758. KEY `FK_civicrm_dedupe_rule_dedupe_rule_group_id` (`dedupe_rule_group_id`)
  759. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ;
  760. +) TYPE=InnoDB AUTO_INCREMENT=8 ;
  761.  
  762. -- --------------------------------------------------------
  763.  
  764. @@ -630,11 +557,11 @@
  765. CREATE TABLE `civicrm_dedupe_rule_group` (
  766. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique dedupe rule group id',
  767. `domain_id` int(10) unsigned NOT NULL COMMENT 'The id of the domain this rule group belongs to',
  768. - `contact_type` enum('Individual','Organization','Household') collate utf8_unicode_ci default NULL COMMENT 'The type of contacts this group applies to',
  769. + `contact_type` enum('Individual','Organization','Household') default NULL COMMENT 'The type of contacts this group applies to',
  770. `threshold` int(11) NOT NULL COMMENT 'The weight threshold the sum of the rule weights has to cross to consider two contacts the same',
  771. PRIMARY KEY (`id`),
  772. KEY `FK_civicrm_dedupe_rule_group_domain_id` (`domain_id`)
  773. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;
  774. +) TYPE=InnoDB AUTO_INCREMENT=4 ;
  775.  
  776. -- --------------------------------------------------------
  777.  
  778. @@ -644,18 +571,17 @@
  779.  
  780. CREATE TABLE `civicrm_domain` (
  781. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Domain ID',
  782. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Name of Domain / Organization',
  783. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Description of Domain.',
  784. - `email_name` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'The default email name that is used in the from address for all outgoing emails',
  785. - `email_address` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'The default email address that is used as the from address for all outgoing emails',
  786. - `email_domain` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'The domain from which outgoing email for this domain will appear to originate',
  787. - `email_return_path` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'The domain from which outgoing email for this domain will appear to originate',
  788. - `config_backend` text collate utf8_unicode_ci COMMENT 'Backend configuration.',
  789. - `version` varchar(8) collate utf8_unicode_ci default NULL COMMENT 'The civicrm version this instance is running',
  790. - `loc_block_id` int(10) unsigned default NULL COMMENT 'FK to Location Block ID. This is specifically not an FK to avoid circular constraints',
  791. + `name` varchar(64) default NULL COMMENT 'Name of Domain / Organization',
  792. + `description` varchar(255) default NULL COMMENT 'Description of Domain.',
  793. + `email_name` varchar(255) default NULL COMMENT 'The default email name that is used in the from address for all outgoing emails',
  794. + `email_address` varchar(255) default NULL COMMENT 'The default email address that is used as the from address for all outgoing emails',
  795. + `email_domain` varchar(64) default NULL COMMENT 'The domain from which outgoing email for this domain will appear to originate',
  796. + `email_return_path` varchar(64) default NULL COMMENT 'The domain from which outgoing email for this domain will appear to originate',
  797. + `config_backend` text COMMENT 'Backend configuration.',
  798. + `config_frontend` text COMMENT 'Frontend configuration.',
  799. PRIMARY KEY (`id`),
  800. UNIQUE KEY `UI_name` (`name`)
  801. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
  802. +) TYPE=InnoDB AUTO_INCREMENT=2 ;
  803.  
  804. -- --------------------------------------------------------
  805.  
  806. @@ -666,11 +592,11 @@
  807. CREATE TABLE `civicrm_dupe_match` (
  808. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique DupeMatch ID',
  809. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this contact',
  810. - `entity_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Name Of Entity Table',
  811. - `rule` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'String that can Contains valid civicrm core or custom field name,parenthesis,,AND,OR ',
  812. + `entity_table` varchar(64) NOT NULL COMMENT 'Name Of Entity Table',
  813. + `rule` varchar(255) default NULL COMMENT 'String that can Contains valid civicrm core or custom field name,parenthesis,,AND,OR ',
  814. PRIMARY KEY (`id`),
  815. KEY `FK_civicrm_dupe_match_domain_id` (`domain_id`)
  816. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
  817. +) TYPE=InnoDB AUTO_INCREMENT=2 ;
  818.  
  819. -- --------------------------------------------------------
  820.  
  821. @@ -680,22 +606,33 @@
  822.  
  823. CREATE TABLE `civicrm_email` (
  824. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Email ID',
  825. - `contact_id` int(10) unsigned default NULL COMMENT 'FK to Contact ID',
  826. - `location_type_id` int(10) unsigned default NULL COMMENT 'Which Location does this email belong to.',
  827. - `email` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Email address',
  828. - `is_primary` tinyint(4) default '0' COMMENT 'Is this the primary?',
  829. - `is_billing` tinyint(4) default '0' COMMENT 'Is this the billing?',
  830. + `location_id` int(10) unsigned NOT NULL COMMENT 'Which Location does this email belong to.',
  831. + `email` varchar(64) default NULL COMMENT 'Email address',
  832. + `is_primary` tinyint(4) default '0' COMMENT 'Is this the primary email for this contact and location.',
  833. `on_hold` tinyint(4) NOT NULL default '0' COMMENT 'Is this address on bounce hold?',
  834. `is_bulkmail` tinyint(4) NOT NULL default '0' COMMENT 'Is this address for bulk mail ?',
  835. `hold_date` datetime default NULL COMMENT 'When the address went on bounce hold',
  836. `reset_date` datetime default NULL COMMENT 'When the address bounce status was last reset',
  837. PRIMARY KEY (`id`),
  838. - KEY `index_location_type` (`location_type_id`),
  839. KEY `UI_email` (`email`),
  840. - KEY `index_is_primary` (`is_primary`),
  841. - KEY `index_is_billing` (`is_billing`),
  842. - KEY `FK_civicrm_email_contact_id` (`contact_id`)
  843. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=88 ;
  844. + KEY `FK_civicrm_email_location_id` (`location_id`)
  845. +) TYPE=InnoDB AUTO_INCREMENT=331 ;
  846. +
  847. +-- --------------------------------------------------------
  848. +
  849. +--
  850. +-- Table structure for table `civicrm_email_history`
  851. +--
  852. +
  853. +CREATE TABLE `civicrm_email_history` (
  854. + `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Email History ID',
  855. + `subject` varchar(255) default NULL COMMENT 'Subject of the email.',
  856. + `message` text COMMENT 'Contents of the email.',
  857. + `contact_id` int(10) unsigned NOT NULL COMMENT 'FK to Contact who is sending this email',
  858. + `sent_date` date default NULL COMMENT 'When was this email sent',
  859. + PRIMARY KEY (`id`),
  860. + KEY `FK_civicrm_email_history_contact_id` (`contact_id`)
  861. +) TYPE=InnoDB AUTO_INCREMENT=2 ;
  862.  
  863. -- --------------------------------------------------------
  864.  
  865. @@ -705,14 +642,14 @@
  866.  
  867. CREATE TABLE `civicrm_entity_file` (
  868. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'primary key',
  869. - `entity_table` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'physical tablename for entity being joined to file, e.g. civicrm_contact',
  870. + `entity_table` varchar(64) default NULL COMMENT 'physical tablename for entity being joined to file, e.g. civicrm_contact',
  871. `entity_id` int(10) unsigned NOT NULL COMMENT 'FK to entity table specified in entity_table column.',
  872. `file_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_file',
  873. PRIMARY KEY (`id`),
  874. KEY `index_entity` (`entity_table`,`entity_id`),
  875. KEY `index_entity_file_id` (`entity_table`,`entity_id`,`file_id`),
  876. KEY `FK_civicrm_entity_file_file_id` (`file_id`)
  877. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  878. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  879.  
  880. -- --------------------------------------------------------
  881.  
  882. @@ -722,12 +659,13 @@
  883.  
  884. CREATE TABLE `civicrm_entity_tag` (
  885. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'primary key',
  886. - `contact_id` int(10) unsigned NOT NULL COMMENT 'FK to contact table.',
  887. + `entity_table` varchar(64) default NULL COMMENT 'physical tablename for entity being tagged, e.g. civicrm_contact',
  888. + `entity_id` int(10) unsigned NOT NULL COMMENT 'FK to entity table specified in entity_table column.',
  889. `tag_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_tag',
  890. PRIMARY KEY (`id`),
  891. - KEY `FK_civicrm_entity_tag_contact_id` (`contact_id`),
  892. + KEY `index_entity` (`entity_table`,`entity_id`),
  893. KEY `FK_civicrm_entity_tag_tag_id` (`tag_id`)
  894. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=60 ;
  895. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  896.  
  897. -- --------------------------------------------------------
  898.  
  899. @@ -738,37 +676,31 @@
  900. CREATE TABLE `civicrm_event` (
  901. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Event',
  902. `domain_id` int(10) unsigned NOT NULL default '0' COMMENT 'Event belongs to which Domain?',
  903. - `title` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Event Title (e.g. Fall Fundraiser Dinner)',
  904. - `summary` text collate utf8_unicode_ci COMMENT 'Brief summary of event. Text and html allowed. Displayed on Event Registration form and can be used on other CMS pages which need an event summary.',
  905. - `description` text collate utf8_unicode_ci COMMENT 'Full description of event. Text and html allowed. Displayed on built-in Event Information screens.',
  906. + `title` varchar(255) default NULL COMMENT 'Event Title (e.g. Fall Fundraiser Dinner)',
  907. + `summary` text COMMENT 'Brief summary of event. Text and html allowed. Displayed on Event Registration form and can be used on other CMS pages which need an event summary.',
  908. + `description` text COMMENT 'Full description of event. Text and html allowed. Displayed on built-in Event Information screens.',
  909. `event_type_id` int(10) unsigned default '0' COMMENT 'Event Type ID.Implicit FK to civicrm_option_value where option_group = event_type.',
  910. - `participant_listing_id` int(10) unsigned default '0' COMMENT 'Should we expose the participant list? Implicit FK to civicrm_option_value where option_group = participant_listing.',
  911. `is_public` tinyint(4) default '1' COMMENT 'Public events will be included in the iCal feeds. Access to private event information may be limited using ACLs.',
  912. `start_date` datetime default NULL COMMENT 'Date and time that event starts.',
  913. `end_date` datetime default NULL COMMENT 'Date and time that event ends. May be NULL if no defined end date/time',
  914. `is_online_registration` tinyint(4) default '0' COMMENT 'If true, include registration link on Event Info page.',
  915. - `registration_link_text` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Text for link to Event Registration form which is displayed on Event Information screen when is_online_registration is true.',
  916. + `registration_link_text` varchar(255) default NULL COMMENT 'Text for link to Event Registration form which is displayed on Event Information screen when is_online_registration is true.',
  917. `registration_start_date` datetime default NULL COMMENT 'Date and time that online registration starts.',
  918. `registration_end_date` datetime default NULL COMMENT 'Date and time that online registration ends.',
  919. `max_participants` int(10) unsigned default '0' COMMENT 'Maximum number of registered participants to allow. After max is reached, a custom Event Full message is displayed. If NULL, allow unlimited number of participants.',
  920. - `event_full_text` text collate utf8_unicode_ci COMMENT 'Message to display on Event Information page and INSTEAD OF Event Registration form if maximum participants are signed up. Can include email address/info about getting on a waiting list, etc. Text and html allowed.',
  921. + `event_full_text` text COMMENT 'Message to display on Event Information page and INSTEAD OF Event Registration form if maximum participants are signed up. Can include email address/info about getting on a waiting list, etc. Text and html allowed.',
  922. `is_monetary` tinyint(4) default '0' COMMENT 'Is this a PAID event? If true, one or more fee amounts must be set and a Payment Processor must be configured for Online Event Registration.',
  923. `contribution_type_id` int(10) unsigned default '0' COMMENT 'Contribution type assigned to paid event registrations for this event. Required if is_monetary is true.',
  924. `payment_processor_id` int(10) unsigned default NULL COMMENT 'Payment Processor for this Event (if is_monetary is true)',
  925. `is_map` tinyint(4) default '0' COMMENT 'Include a map block on the Event Information page when geocode info is available and a mapping provider has been specified?',
  926. `is_active` tinyint(4) default '0' COMMENT 'Is this Event enabled or disabled/cancelled?',
  927. - `fee_label` varchar(255) collate utf8_unicode_ci default NULL,
  928. + `fee_label` varchar(255) default NULL,
  929. `is_show_location` tinyint(4) default '1' COMMENT 'If true, show event location.',
  930. - `loc_block_id` int(10) unsigned default NULL COMMENT 'FK to Location Block ID',
  931. - `receipt_text` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Receipt Text for off-line event participation',
  932. - `default_role_id` int(10) unsigned default '1' COMMENT 'Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.',
  933. PRIMARY KEY (`id`),
  934. KEY `index_event_type_id` (`event_type_id`),
  935. - KEY `index_participant_listing_id` (`participant_listing_id`),
  936. KEY `FK_civicrm_event_domain_id` (`domain_id`),
  937. - KEY `FK_civicrm_event_payment_processor_id` (`payment_processor_id`),
  938. - KEY `FK_civicrm_event_loc_block_id` (`loc_block_id`)
  939. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;
  940. + KEY `FK_civicrm_event_payment_processor_id` (`payment_processor_id`)
  941. +) TYPE=InnoDB AUTO_INCREMENT=7 ;
  942.  
  943. -- --------------------------------------------------------
  944.  
  945. @@ -779,27 +711,23 @@
  946. CREATE TABLE `civicrm_event_page` (
  947. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Event Page ID',
  948. `event_id` int(10) unsigned NOT NULL COMMENT 'Event which this page belongs to.',
  949. - `intro_text` text collate utf8_unicode_ci COMMENT 'Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.',
  950. - `footer_text` text collate utf8_unicode_ci COMMENT 'Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.',
  951. - `confirm_title` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Title for Confirmation page.',
  952. - `confirm_text` text collate utf8_unicode_ci COMMENT 'Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.',
  953. - `confirm_footer_text` text collate utf8_unicode_ci COMMENT 'Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.',
  954. + `intro_text` text COMMENT 'Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.',
  955. + `footer_text` text COMMENT 'Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.',
  956. + `confirm_title` varchar(255) default NULL COMMENT 'Title for Confirmation page.',
  957. + `confirm_text` text COMMENT 'Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.',
  958. + `confirm_footer_text` text COMMENT 'Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.',
  959. `is_email_confirm` tinyint(4) default '1' COMMENT 'If true, confirmation is automatically emailed to contact on successful registration.',
  960. - `confirm_email_text` text collate utf8_unicode_ci COMMENT 'text to include above standard event info on confirmation email. emails are text-only, so do not allow html for now',
  961. - `confirm_from_name` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'FROM email name used for confirmation emails.',
  962. - `confirm_from_email` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'FROM email address used for confirmation emails.',
  963. - `cc_confirm` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'comma-separated list of email addresses to cc each time a confirmation is sent',
  964. - `bcc_confirm` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'comma-separated list of email addresses to bcc each time a confirmation is sent',
  965. - `default_fee_id` int(10) unsigned default NULL COMMENT 'FK to civicrm_option_value.',
  966. - `thankyou_title` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Title for ThankYou page.',
  967. - `thankyou_text` text collate utf8_unicode_ci COMMENT 'ThankYou Text.',
  968. - `thankyou_footer_text` text collate utf8_unicode_ci COMMENT 'Footer message.',
  969. - `is_pay_later` tinyint(4) default '0' COMMENT 'if true - allows the user to send payment directly to the org later',
  970. - `pay_later_text` text collate utf8_unicode_ci COMMENT 'The text displayed to the user in the main form',
  971. - `pay_later_receipt` text collate utf8_unicode_ci COMMENT 'The receipt sent to the user instead of the normal receipt text',
  972. - PRIMARY KEY (`id`),
  973. - KEY `FK_civicrm_event_page_event_id` (`event_id`)
  974. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;
  975. + `confirm_email_text` text COMMENT 'text to include above standard event info on confirmation email. emails are text-only, so do not allow html for now',
  976. + `confirm_from_name` varchar(255) default NULL COMMENT 'FROM email name used for confirmation emails.',
  977. + `confirm_from_email` varchar(255) default NULL COMMENT 'FROM email address used for confirmation emails.',
  978. + `cc_confirm` varchar(255) default NULL COMMENT 'comma-separated list of email addresses to cc each time a confirmation is sent',
  979. + `bcc_confirm` varchar(255) default NULL COMMENT 'comma-separated list of email addresses to bcc each time a confirmation is sent',
  980. + `default_fee_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_custom_option.',
  981. + `thankyou_title` varchar(255) default NULL COMMENT 'Title for ThankYou page.',
  982. + `thankyou_text` text COMMENT 'ThankYou Text.',
  983. + `thankyou_footer_text` text COMMENT 'Footer message.',
  984. + PRIMARY KEY (`id`)
  985. +) TYPE=InnoDB AUTO_INCREMENT=7 ;
  986.  
  987. -- --------------------------------------------------------
  988.  
  989. @@ -810,13 +738,13 @@
  990. CREATE TABLE `civicrm_file` (
  991. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID',
  992. `file_type_id` int(10) unsigned default NULL COMMENT 'Type of file (e.g. Transcript, Income Tax Return, etc). FK to civicrm_option_value.',
  993. - `mime_type` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'mime type of the document',
  994. - `uri` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'uri of the file on disk',
  995. + `mime_type` varchar(255) default NULL COMMENT 'mime type of the document',
  996. + `uri` varchar(255) default NULL COMMENT 'uri of the file on disk',
  997. `document` mediumblob COMMENT 'contents of the document',
  998. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Additional descriptive text regarding this attachment (optional).',
  999. + `description` varchar(255) default NULL COMMENT 'Additional descriptive text regarding this attachment (optional).',
  1000. `upload_date` datetime default NULL COMMENT 'Date and time that this attachment was uploaded or written to server.',
  1001. PRIMARY KEY (`id`)
  1002. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1003. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1004.  
  1005. -- --------------------------------------------------------
  1006.  
  1007. @@ -827,47 +755,36 @@
  1008. CREATE TABLE `civicrm_financial_trxn` (
  1009. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Gift ID',
  1010. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this gift class.',
  1011. - `contribution_id` int(10) unsigned NOT NULL COMMENT 'FK to contribution table.',
  1012. + `entity_table` varchar(64) default NULL COMMENT 'physical tablename for entity being extended by this data, e.g. civicrm_contact',
  1013. + `entity_id` int(10) unsigned NOT NULL COMMENT 'FK to record in the entity table specified by entity_table column.',
  1014. `trxn_date` datetime NOT NULL,
  1015. - `trxn_type` enum('Debit','Credit') collate utf8_unicode_ci NOT NULL,
  1016. + `trxn_type` enum('Debit','Credit') NOT NULL,
  1017. `total_amount` decimal(20,2) NOT NULL COMMENT 'amount of transaction',
  1018. `fee_amount` decimal(20,2) default NULL COMMENT 'actual processor fee if known - may be 0.',
  1019. `net_amount` decimal(20,2) default NULL COMMENT 'actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.',
  1020. - `currency` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT '3 character string, value derived from payment processor config setting.',
  1021. - `payment_processor` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'derived from Processor setting in civicrm.settings.php.',
  1022. - `trxn_id` varchar(255) collate utf8_unicode_ci NOT NULL COMMENT 'unique processor transaction id, bank id + trans id,... depending on payment_method',
  1023. - `trxn_result_code` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'processor result code',
  1024. + `currency` varchar(64) NOT NULL COMMENT '3 character string, value derived from payment processor config setting.',
  1025. + `payment_processor` varchar(64) NOT NULL COMMENT 'derived from Processor setting in civicrm.settings.php.',
  1026. + `trxn_id` varchar(255) NOT NULL COMMENT 'unique processor transaction id, bank id + trans id,... depending on payment_method',
  1027. + `trxn_result_code` varchar(255) default NULL COMMENT 'processor result code',
  1028. PRIMARY KEY (`id`),
  1029. UNIQUE KEY `UI_ft_trxn_id_domain_id` (`trxn_id`,`domain_id`),
  1030. - KEY `FK_civicrm_financial_trxn_domain_id` (`domain_id`),
  1031. - KEY `FK_civicrm_financial_trxn_contribution_id` (`contribution_id`)
  1032. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1033. + KEY `index_entity` (`entity_table`,`entity_id`),
  1034. + KEY `FK_civicrm_financial_trxn_domain_id` (`domain_id`)
  1035. +) TYPE=InnoDB AUTO_INCREMENT=43 ;
  1036.  
  1037. -- --------------------------------------------------------
  1038.  
  1039. --
  1040. --- Table structure for table `civicrm_grant`
  1041. +-- Table structure for table `civicrm_geo_coord`
  1042. --
  1043.  
  1044. -CREATE TABLE `civicrm_grant` (
  1045. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Grant id',
  1046. - `contact_id` int(10) unsigned NOT NULL COMMENT 'Contact ID of contact record given grant belongs to.',
  1047. - `application_received_date` date default NULL COMMENT 'Date on which grant application was received by donor.',
  1048. - `decision_date` date default NULL COMMENT 'Date on which grant decision was made.',
  1049. - `money_transfer_date` date default NULL COMMENT 'Date on which grant money transfer was made.',
  1050. - `grant_due_date` date default NULL COMMENT 'Date on which grant report is due.',
  1051. - `grant_report_received` tinyint(4) default NULL COMMENT 'Yes/No field stating whether grant report was received by donor.',
  1052. - `grant_type_id` int(10) unsigned NOT NULL COMMENT 'Id of first case category.',
  1053. - `amount_total` decimal(20,2) NOT NULL COMMENT 'Total amount, in default currency.',
  1054. - `amount_requested` decimal(20,2) NOT NULL COMMENT 'Requested amount, in default currency.',
  1055. - `amount_granted` decimal(20,2) NOT NULL COMMENT 'Granted amount, in default currency.',
  1056. - `rationale` text collate utf8_unicode_ci COMMENT 'Grant rationale.',
  1057. - `status_id` int(10) unsigned NOT NULL COMMENT 'Id of Grant status.',
  1058. - PRIMARY KEY (`id`),
  1059. - KEY `index_grant_type_id` (`grant_type_id`),
  1060. - KEY `index_status_id` (`status_id`),
  1061. - KEY `FK_civicrm_grant_contact_id` (`contact_id`)
  1062. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1063. +CREATE TABLE `civicrm_geo_coord` (
  1064. + `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Geo Coord ID',
  1065. + `coord_type` enum('LatLong','Projected') default NULL COMMENT 'Projected or unprojected coordinates - projected coordinates (e.g. UTM) may be treated as cartesian by some modules.',
  1066. + `coord_units` enum('Degree','Grad','Radian','Foot','Meter') default NULL COMMENT 'If the coord_type is LATLONG, indicate the unit of angular measure: Degree|Grad|Radian. If the coord_type is Projected, indicate unit of distance measure: Foot|Meter.',
  1067. + `coord_ogc_wkt_string` text COMMENT 'Coordinate sys description in Open GIS Consortium WKT (well known text) format - see http://www.opengeospatial.org/docs/01-009.pdf this is provided for the convenience of the user or third party modules.',
  1068. + PRIMARY KEY (`id`)
  1069. +) TYPE=InnoDB AUTO_INCREMENT=2 ;
  1070.  
  1071. -- --------------------------------------------------------
  1072.  
  1073. @@ -878,24 +795,24 @@
  1074. CREATE TABLE `civicrm_group` (
  1075. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Group ID',
  1076. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this group',
  1077. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Internal name of Group.',
  1078. - `title` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Name of Group.',
  1079. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Optional verbose description of the group.',
  1080. - `source` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Module or process which created this group.',
  1081. + `name` varchar(64) default NULL COMMENT 'Internal name of Group.',
  1082. + `title` varchar(64) default NULL COMMENT 'Name of Group.',
  1083. + `description` varchar(255) default NULL COMMENT 'Optional verbose description of the group.',
  1084. + `source` varchar(64) default NULL COMMENT 'Module or process which created this group.',
  1085. `saved_search_id` int(10) unsigned default NULL COMMENT 'FK to saved search table.',
  1086. `is_active` tinyint(4) default NULL COMMENT 'Is this entry active?',
  1087. - `visibility` enum('User and User Admin Only','Public User Pages','Public User Pages and Listings') collate utf8_unicode_ci default 'User and User Admin Only' COMMENT 'In what context(s) is this field visible.',
  1088. - `where_clause` text collate utf8_unicode_ci COMMENT 'the sql where clause if a saved search acl',
  1089. - `select_tables` text collate utf8_unicode_ci COMMENT 'the tables to be included in a select data',
  1090. - `where_tables` text collate utf8_unicode_ci COMMENT 'the tables to be included in the count statement',
  1091. - `group_type` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'FK to group type',
  1092. + `visibility` enum('User and User Admin Only','Public User Pages','Public User Pages and Listings') default 'User and User Admin Only' COMMENT 'In what context(s) is this field visible.',
  1093. + `where_clause` text COMMENT 'the sql where clause if a saved search acl',
  1094. + `select_tables` text COMMENT 'the tables to be included in a select data',
  1095. + `where_tables` text COMMENT 'the tables to be included in the count statement',
  1096. + `group_type` varchar(128) default NULL COMMENT 'FK to group type',
  1097. PRIMARY KEY (`id`),
  1098. UNIQUE KEY `UI_title_domain_id` (`title`,`domain_id`),
  1099. UNIQUE KEY `UI_name_domain_id` (`name`,`domain_id`),
  1100. KEY `index_group_type` (`group_type`),
  1101. KEY `FK_civicrm_group_domain_id` (`domain_id`),
  1102. KEY `FK_civicrm_group_saved_search_id` (`saved_search_id`)
  1103. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ;
  1104. +) TYPE=InnoDB AUTO_INCREMENT=2 ;
  1105.  
  1106. -- --------------------------------------------------------
  1107.  
  1108. @@ -907,7 +824,7 @@
  1109. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'primary key',
  1110. `group_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_group',
  1111. `contact_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_contact',
  1112. - `status` enum('Added','Removed','Pending') collate utf8_unicode_ci default NULL COMMENT 'status of contact relative to membership in group',
  1113. + `status` enum('Added','Removed','Pending') default NULL COMMENT 'status of contact relative to membership in group',
  1114. `location_id` int(10) unsigned default NULL COMMENT 'Optional location to associate with this membership',
  1115. `email_id` int(10) unsigned default NULL COMMENT 'Optional email to associate with this membership',
  1116. PRIMARY KEY (`id`),
  1117. @@ -915,59 +832,74 @@
  1118. KEY `FK_civicrm_group_contact_group_id` (`group_id`),
  1119. KEY `FK_civicrm_group_contact_location_id` (`location_id`),
  1120. KEY `FK_civicrm_group_contact_email_id` (`email_id`)
  1121. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=55 ;
  1122. +) TYPE=InnoDB AUTO_INCREMENT=170 ;
  1123.  
  1124. -- --------------------------------------------------------
  1125.  
  1126. --
  1127. --- Table structure for table `civicrm_group_nesting`
  1128. +-- Table structure for table `civicrm_household`
  1129. --
  1130.  
  1131. -CREATE TABLE `civicrm_group_nesting` (
  1132. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Relationship ID',
  1133. - `child_group_id` int(10) unsigned NOT NULL COMMENT 'ID of the child group',
  1134. - `parent_group_id` int(10) unsigned NOT NULL COMMENT 'ID of the parent group',
  1135. +CREATE TABLE `civicrm_household` (
  1136. + `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Household ID',
  1137. + `contact_id` int(10) unsigned NOT NULL COMMENT 'FK to Contact ID',
  1138. + `household_name` varchar(128) default NULL COMMENT 'Household Name.',
  1139. + `primary_contact_id` int(10) unsigned default NULL COMMENT 'Optional FK to Primary Contact for this household.',
  1140. PRIMARY KEY (`id`),
  1141. - KEY `FK_civicrm_group_nesting_child_group_id` (`child_group_id`),
  1142. - KEY `FK_civicrm_group_nesting_parent_group_id` (`parent_group_id`)
  1143. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1144. + UNIQUE KEY `UI_contact` (`contact_id`),
  1145. + KEY `index_household_name` (`household_name`),
  1146. + KEY `FK_civicrm_household_primary_contact_id` (`primary_contact_id`)
  1147. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1148.  
  1149. -- --------------------------------------------------------
  1150.  
  1151. --
  1152. --- Table structure for table `civicrm_group_organization`
  1153. +-- Table structure for table `civicrm_im`
  1154. --
  1155.  
  1156. -CREATE TABLE `civicrm_group_organization` (
  1157. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Relationship ID',
  1158. - `group_id` int(10) unsigned NOT NULL COMMENT 'ID of the group',
  1159. - `organization_id` int(10) unsigned NOT NULL COMMENT 'ID of the Organization Contact',
  1160. +CREATE TABLE `civicrm_im` (
  1161. + `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique IM ID',
  1162. + `location_id` int(10) unsigned NOT NULL COMMENT 'Which Location does this IM identifier belong to.',
  1163. + `name` varchar(64) default NULL COMMENT 'IM screen name',
  1164. + `provider_id` int(10) unsigned default NULL COMMENT 'Which IM Provider does this screen name belong to.',
  1165. + `is_primary` tinyint(4) default '0' COMMENT 'Is this the primary IM for this contact and location.',
  1166. PRIMARY KEY (`id`),
  1167. - KEY `FK_civicrm_group_organization_group_id` (`group_id`),
  1168. - KEY `FK_civicrm_group_organization_organization_id` (`organization_id`)
  1169. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1170. + KEY `UI_provider_id` (`provider_id`),
  1171. + KEY `FK_civicrm_im_location_id` (`location_id`)
  1172. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1173.  
  1174. -- --------------------------------------------------------
  1175.  
  1176. --
  1177. --- Table structure for table `civicrm_im`
  1178. +-- Table structure for table `civicrm_individual`
  1179. --
  1180.  
  1181. -CREATE TABLE `civicrm_im` (
  1182. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique IM ID',
  1183. - `contact_id` int(10) unsigned default NULL COMMENT 'FK to Contact ID',
  1184. - `location_type_id` int(10) unsigned default NULL COMMENT 'Which Location does this email belong to.',
  1185. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'IM screen name',
  1186. - `provider_id` int(10) unsigned default NULL COMMENT 'Which IM Provider does this screen name belong to.',
  1187. - `is_primary` tinyint(4) default '0' COMMENT 'Is this the primary IM for this contact and location.',
  1188. - `is_billing` tinyint(4) default '0' COMMENT 'Is this the billing?',
  1189. +CREATE TABLE `civicrm_individual` (
  1190. + `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Individual ID',
  1191. + `contact_id` int(10) unsigned NOT NULL COMMENT 'FK to Contact ID',
  1192. + `first_name` varchar(64) default NULL COMMENT 'First Name.',
  1193. + `middle_name` varchar(64) default NULL COMMENT 'Middle Name.',
  1194. + `last_name` varchar(64) default NULL COMMENT 'Last Name.',
  1195. + `prefix_id` int(10) unsigned default NULL COMMENT 'Prefix or Title for name (Ms, Mr...). FK to prefix ID',
  1196. + `suffix_id` int(10) unsigned default NULL COMMENT 'Suffix for name (Jr, Sr...). FK to suffix ID',
  1197. + `greeting_type` enum('Formal','Informal','Honorific','Custom','Other') default NULL COMMENT 'Preferred greeting format.',
  1198. + `custom_greeting` varchar(128) default NULL COMMENT 'Custom greeting message.',
  1199. + `job_title` varchar(64) default NULL COMMENT 'Job Title',
  1200. + `gender_id` int(10) unsigned default NULL COMMENT 'FK to gender ID',
  1201. + `birth_date` date default NULL COMMENT 'Date of birth',
  1202. + `is_deceased` tinyint(4) default '0',
  1203. + `deceased_date` date default NULL COMMENT 'Date of deceased',
  1204. + `phone_to_household_id` int(10) unsigned default NULL COMMENT 'OPTIONAL FK to civicrm_contact_household record. If NOT NULL, direct phone communications to household rather than individual location.',
  1205. + `email_to_household_id` int(10) unsigned default NULL COMMENT 'OPTIONAL FK to civicrm_contact_household record. If NOT NULL, direct phone communications to household rather than individual location.',
  1206. + `mail_to_household_id` int(10) unsigned default NULL COMMENT 'OPTIONAL FK to civicrm_contact_household record. If NOT NULL, direct mail communications to household rather than individual location.',
  1207. PRIMARY KEY (`id`),
  1208. - KEY `index_location_type` (`location_type_id`),
  1209. - KEY `UI_provider_id` (`provider_id`),
  1210. - KEY `index_is_primary` (`is_primary`),
  1211. - KEY `index_is_billing` (`is_billing`),
  1212. - KEY `FK_civicrm_im_contact_id` (`contact_id`)
  1213. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1214. + UNIQUE KEY `UI_contact` (`contact_id`),
  1215. + KEY `index_first_name` (`first_name`),
  1216. + KEY `index_last_name` (`last_name`),
  1217. + KEY `UI_prefix` (`prefix_id`),
  1218. + KEY `UI_suffix` (`suffix_id`),
  1219. + KEY `UI_gender` (`gender_id`)
  1220. +) TYPE=InnoDB AUTO_INCREMENT=241 ;
  1221.  
  1222. -- --------------------------------------------------------
  1223.  
  1224. @@ -977,18 +909,38 @@
  1225.  
  1226. CREATE TABLE `civicrm_line_item` (
  1227. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Line Item',
  1228. - `entity_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'table which has the transaction',
  1229. + `entity_table` varchar(64) NOT NULL COMMENT 'table which has the transaction',
  1230. `entity_id` int(10) unsigned NOT NULL COMMENT 'entry in table',
  1231. `price_field_id` int(10) unsigned NOT NULL COMMENT 'FK to price_field',
  1232. - `option_group_id` int(10) unsigned NOT NULL COMMENT 'FK to option group',
  1233. - `label` varchar(255) collate utf8_unicode_ci NOT NULL COMMENT 'descriptive label for item - from custom_option.label',
  1234. + `custom_option_id` int(10) unsigned NOT NULL COMMENT 'FK to custom_option',
  1235. + `label` varchar(255) NOT NULL COMMENT 'descriptive label for item - from custom_option.label',
  1236. `qty` int(10) unsigned NOT NULL COMMENT 'How many items ordered',
  1237. `unit_price` decimal(20,2) NOT NULL COMMENT 'price of each item',
  1238. `line_total` decimal(20,2) NOT NULL COMMENT 'qty * unit_price',
  1239. PRIMARY KEY (`id`),
  1240. KEY `index_entity` (`entity_table`,`entity_id`),
  1241. - KEY `FK_civicrm_line_item_price_field_id` (`price_field_id`)
  1242. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1243. + KEY `FK_civicrm_line_item_price_field_id` (`price_field_id`),
  1244. + KEY `FK_civicrm_line_item_custom_option_id` (`custom_option_id`)
  1245. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1246. +
  1247. +-- --------------------------------------------------------
  1248. +
  1249. +--
  1250. +-- Table structure for table `civicrm_location`
  1251. +--
  1252. +
  1253. +CREATE TABLE `civicrm_location` (
  1254. + `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Location ID',
  1255. + `entity_table` varchar(64) NOT NULL COMMENT 'Name of table where item being referenced is stored.',
  1256. + `entity_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to the referenced item.',
  1257. + `location_type_id` int(10) unsigned default NULL COMMENT 'FK to Location Type ID. Optional so we can reset location type id ( CRM-1986 )',
  1258. + `is_primary` tinyint(4) default '0' COMMENT 'Is this the primary location for the contact. (allow only ONE primary location / contact.)',
  1259. + `name` varchar(255) default NULL,
  1260. + PRIMARY KEY (`id`),
  1261. + UNIQUE KEY `index_entity_location_type` (`entity_table`,`entity_id`,`location_type_id`),
  1262. + KEY `index_entity` (`entity_table`,`entity_id`),
  1263. + KEY `FK_civicrm_location_location_type_id` (`location_type_id`)
  1264. +) TYPE=InnoDB AUTO_INCREMENT=334 ;
  1265.  
  1266. -- --------------------------------------------------------
  1267.  
  1268. @@ -999,44 +951,16 @@
  1269. CREATE TABLE `civicrm_location_type` (
  1270. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Location Type ID',
  1271. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this location type.',
  1272. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Location Type Name.',
  1273. - `vcard_name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'vCard Location Type Name.',
  1274. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Location Type Description.',
  1275. + `name` varchar(64) default NULL COMMENT 'Location Type Name.',
  1276. + `vcard_name` varchar(64) default NULL COMMENT 'vCard Location Type Name.',
  1277. + `description` varchar(255) default NULL COMMENT 'Location Type Description.',
  1278. `is_reserved` tinyint(4) default NULL COMMENT 'Is this location type a predefined system location?',
  1279. `is_active` tinyint(4) default NULL COMMENT 'Is this property active?',
  1280. `is_default` tinyint(4) default NULL COMMENT 'Is this location type the default?',
  1281. PRIMARY KEY (`id`),
  1282. UNIQUE KEY `UI_name_domain_id` (`name`,`domain_id`),
  1283. KEY `FK_civicrm_location_type_domain_id` (`domain_id`)
  1284. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ;
  1285. -
  1286. --- --------------------------------------------------------
  1287. -
  1288. ---
  1289. --- Table structure for table `civicrm_loc_block`
  1290. ---
  1291. -
  1292. -CREATE TABLE `civicrm_loc_block` (
  1293. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique ID',
  1294. - `address_id` int(10) unsigned default NULL,
  1295. - `email_id` int(10) unsigned default NULL,
  1296. - `phone_id` int(10) unsigned default NULL,
  1297. - `im_id` int(10) unsigned default NULL,
  1298. - `address_2_id` int(10) unsigned default NULL,
  1299. - `email_2_id` int(10) unsigned default NULL,
  1300. - `phone_2_id` int(10) unsigned default NULL,
  1301. - `im_2_id` int(10) unsigned default NULL,
  1302. - `name` varchar(255) collate utf8_unicode_ci default NULL,
  1303. - PRIMARY KEY (`id`),
  1304. - KEY `FK_civicrm_loc_block_address_id` (`address_id`),
  1305. - KEY `FK_civicrm_loc_block_email_id` (`email_id`),
  1306. - KEY `FK_civicrm_loc_block_phone_id` (`phone_id`),
  1307. - KEY `FK_civicrm_loc_block_im_id` (`im_id`),
  1308. - KEY `FK_civicrm_loc_block_address_2_id` (`address_2_id`),
  1309. - KEY `FK_civicrm_loc_block_email_2_id` (`email_2_id`),
  1310. - KEY `FK_civicrm_loc_block_phone_2_id` (`phone_2_id`),
  1311. - KEY `FK_civicrm_loc_block_im_2_id` (`im_2_id`)
  1312. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ;
  1313. +) TYPE=InnoDB AUTO_INCREMENT=6 ;
  1314.  
  1315. -- --------------------------------------------------------
  1316.  
  1317. @@ -1046,15 +970,15 @@
  1318.  
  1319. CREATE TABLE `civicrm_log` (
  1320. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Log ID',
  1321. - `entity_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Name of table where item being referenced is stored.',
  1322. + `entity_table` varchar(64) NOT NULL COMMENT 'Name of table where item being referenced is stored.',
  1323. `entity_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to the referenced item.',
  1324. - `data` text collate utf8_unicode_ci COMMENT 'Updates does to this object if any.',
  1325. + `data` text COMMENT 'Updates does to this object if any.',
  1326. `modified_id` int(10) unsigned default NULL COMMENT 'FK to Contact ID of person under whose credentials this data modification was made.',
  1327. `modified_date` datetime default NULL COMMENT 'When was the referenced entity created or modified or deleted.',
  1328. PRIMARY KEY (`id`),
  1329. KEY `index_entity` (`entity_table`,`entity_id`),
  1330. KEY `FK_civicrm_log_modified_id` (`modified_id`)
  1331. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
  1332. +) TYPE=InnoDB AUTO_INCREMENT=190 ;
  1333.  
  1334. -- --------------------------------------------------------
  1335.  
  1336. @@ -1067,17 +991,16 @@
  1337. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this mailing',
  1338. `header_id` int(10) unsigned default NULL COMMENT 'FK to the header component.',
  1339. `footer_id` int(10) unsigned default NULL COMMENT 'FK to the footer component.',
  1340. - `reply_id` int(10) unsigned default NULL COMMENT 'FK to the auto-responder component.',
  1341. - `unsubscribe_id` int(10) unsigned default NULL COMMENT 'FK to the unsubscribe component.',
  1342. - `resubscribe_id` int(10) unsigned default NULL,
  1343. - `optout_id` int(10) unsigned default NULL COMMENT 'FK to the opt-out component.',
  1344. - `name` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Mailing Name.',
  1345. - `from_name` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'From Header of mailing',
  1346. - `from_email` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'From Email of mailing',
  1347. - `replyto_email` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Reply-To Email of mailing',
  1348. - `subject` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Subject of mailing',
  1349. - `body_text` text collate utf8_unicode_ci COMMENT 'Body of the mailing in text format.',
  1350. - `body_html` text collate utf8_unicode_ci COMMENT 'Body of the mailing in html format.',
  1351. + `reply_id` int(10) unsigned NOT NULL COMMENT 'FK to the auto-responder component.',
  1352. + `unsubscribe_id` int(10) unsigned NOT NULL COMMENT 'FK to the unsubscribe component.',
  1353. + `optout_id` int(10) unsigned NOT NULL COMMENT 'FK to the opt-out component.',
  1354. + `name` varchar(128) default NULL COMMENT 'Mailing Name.',
  1355. + `from_name` varchar(128) default NULL COMMENT 'From Header of mailing',
  1356. + `from_email` varchar(128) default NULL COMMENT 'From Email of mailing',
  1357. + `replyto_email` varchar(128) default NULL COMMENT 'Reply-To Email of mailing',
  1358. + `subject` varchar(128) default NULL COMMENT 'Subject of mailing',
  1359. + `body_text` text COMMENT 'Body of the mailing in text format.',
  1360. + `body_html` text COMMENT 'Body of the mailing in html format.',
  1361. `url_tracking` tinyint(4) default NULL COMMENT 'Should we track URL click-throughs for this mailing?',
  1362. `forward_replies` tinyint(4) default NULL COMMENT 'Should we forward replies back to the author?',
  1363. `auto_responder` tinyint(4) default NULL COMMENT 'Should we enable the auto-responder?',
  1364. @@ -1092,7 +1015,7 @@
  1365. KEY `FK_civicrm_mailing_unsubscribe_id` (`unsubscribe_id`),
  1366. KEY `FK_civicrm_mailing_optout_id` (`optout_id`),
  1367. KEY `FK_civicrm_mailing_msg_template_id` (`msg_template_id`)
  1368. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1369. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1370.  
  1371. -- --------------------------------------------------------
  1372.  
  1373. @@ -1103,10 +1026,10 @@
  1374. CREATE TABLE `civicrm_mailing_bounce_pattern` (
  1375. `id` int(10) unsigned NOT NULL auto_increment,
  1376. `bounce_type_id` int(10) unsigned NOT NULL COMMENT 'Type of bounce',
  1377. - `pattern` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'A regexp to match a message to a bounce type',
  1378. + `pattern` varchar(255) default NULL COMMENT 'A regexp to match a message to a bounce type',
  1379. PRIMARY KEY (`id`),
  1380. KEY `FK_civicrm_mailing_bounce_pattern_bounce_type_id` (`bounce_type_id`)
  1381. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=123 ;
  1382. +) TYPE=InnoDB AUTO_INCREMENT=123 ;
  1383.  
  1384. -- --------------------------------------------------------
  1385.  
  1386. @@ -1116,11 +1039,11 @@
  1387.  
  1388. CREATE TABLE `civicrm_mailing_bounce_type` (
  1389. `id` int(10) unsigned NOT NULL auto_increment,
  1390. - `name` enum('AOL','Away','DNS','Host','Inactive','Invalid','Loop','Quota','Relay','Spam','Syntax','Unknown') collate utf8_unicode_ci NOT NULL COMMENT 'Type of bounce',
  1391. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'A description of this bounce type',
  1392. + `name` enum('AOL','Away','DNS','Host','Inactive','Invalid','Loop','Quota','Relay','Spam','Syntax','Unknown') NOT NULL COMMENT 'Type of bounce',
  1393. + `description` varchar(255) default NULL COMMENT 'A description of this bounce type',
  1394. `hold_threshold` int(10) unsigned NOT NULL COMMENT 'Number of bounces of this type required before the email address is put on bounce hold',
  1395. PRIMARY KEY (`id`)
  1396. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=12 ;
  1397. +) TYPE=InnoDB AUTO_INCREMENT=12 ;
  1398.  
  1399. -- --------------------------------------------------------
  1400.  
  1401. @@ -1131,16 +1054,16 @@
  1402. CREATE TABLE `civicrm_mailing_component` (
  1403. `id` int(10) unsigned NOT NULL auto_increment,
  1404. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this component',
  1405. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'The name of this component',
  1406. - `component_type` enum('Header','Footer','Subscribe','Welcome','Unsubscribe','OptOut','Reply','Resubscribe') collate utf8_unicode_ci default NULL COMMENT 'Type of Component.',
  1407. - `subject` varchar(255) collate utf8_unicode_ci default NULL,
  1408. - `body_html` text collate utf8_unicode_ci COMMENT 'Body of the component in html format.',
  1409. - `body_text` text collate utf8_unicode_ci COMMENT 'Body of the component in text format.',
  1410. + `name` varchar(64) default NULL COMMENT 'The name of this component',
  1411. + `component_type` enum('Header','Footer','Subscribe','Welcome','Unsubscribe','OptOut','Reply','Resubscribe') default NULL COMMENT 'Type of Component.',
  1412. + `subject` varchar(255) default NULL,
  1413. + `body_html` text COMMENT 'Body of the component in html format.',
  1414. + `body_text` text COMMENT 'Body of the component in text format.',
  1415. `is_default` tinyint(4) default '0' COMMENT 'Is this the default component for this component_type?',
  1416. `is_active` tinyint(4) default NULL COMMENT 'Is this property active?',
  1417. PRIMARY KEY (`id`),
  1418. KEY `FK_civicrm_mailing_component_domain_id` (`domain_id`)
  1419. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=9 ;
  1420. +) TYPE=InnoDB AUTO_INCREMENT=10 ;
  1421.  
  1422. -- --------------------------------------------------------
  1423.  
  1424. @@ -1152,11 +1075,11 @@
  1425. `id` int(10) unsigned NOT NULL auto_increment,
  1426. `event_queue_id` int(10) unsigned NOT NULL COMMENT 'FK to EventQueue',
  1427. `bounce_type_id` int(10) unsigned default NULL COMMENT 'What type of bounce was it?',
  1428. - `bounce_reason` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'The reason the email bounced.',
  1429. + `bounce_reason` varchar(255) default NULL COMMENT 'The reason the email bounced.',
  1430. `time_stamp` datetime NOT NULL COMMENT 'When this bounce event occurred.',
  1431. PRIMARY KEY (`id`),
  1432. KEY `FK_civicrm_mailing_event_bounce_event_queue_id` (`event_queue_id`)
  1433. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1434. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1435.  
  1436. -- --------------------------------------------------------
  1437.  
  1438. @@ -1170,7 +1093,7 @@
  1439. `time_stamp` datetime NOT NULL COMMENT 'When this confirmation event occurred.',
  1440. PRIMARY KEY (`id`),
  1441. KEY `FK_civicrm_mailing_event_confirm_event_subscribe_id` (`event_subscribe_id`)
  1442. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1443. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1444.  
  1445. -- --------------------------------------------------------
  1446.  
  1447. @@ -1184,7 +1107,7 @@
  1448. `time_stamp` datetime NOT NULL COMMENT 'When this delivery event occurred.',
  1449. PRIMARY KEY (`id`),
  1450. KEY `FK_civicrm_mailing_event_delivered_event_queue_id` (`event_queue_id`)
  1451. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1452. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1453.  
  1454. -- --------------------------------------------------------
  1455.  
  1456. @@ -1200,7 +1123,7 @@
  1457. PRIMARY KEY (`id`),
  1458. KEY `FK_civicrm_mailing_event_forward_event_queue_id` (`event_queue_id`),
  1459. KEY `FK_civicrm_mailing_event_forward_dest_queue_id` (`dest_queue_id`)
  1460. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1461. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1462.  
  1463. -- --------------------------------------------------------
  1464.  
  1465. @@ -1214,7 +1137,7 @@
  1466. `time_stamp` datetime NOT NULL COMMENT 'When this open event occurred.',
  1467. PRIMARY KEY (`id`),
  1468. KEY `FK_civicrm_mailing_event_opened_event_queue_id` (`event_queue_id`)
  1469. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1470. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1471.  
  1472. -- --------------------------------------------------------
  1473.  
  1474. @@ -1227,12 +1150,12 @@
  1475. `job_id` int(10) unsigned NOT NULL COMMENT 'FK to Job',
  1476. `email_id` int(10) unsigned NOT NULL COMMENT 'FK to Email',
  1477. `contact_id` int(10) unsigned NOT NULL COMMENT 'FK to Contact',
  1478. - `hash` varchar(255) collate utf8_unicode_ci NOT NULL COMMENT 'Security hash',
  1479. + `hash` varchar(255) NOT NULL COMMENT 'Security hash',
  1480. PRIMARY KEY (`id`),
  1481. KEY `FK_civicrm_mailing_event_queue_job_id` (`job_id`),
  1482. KEY `FK_civicrm_mailing_event_queue_email_id` (`email_id`),
  1483. KEY `FK_civicrm_mailing_event_queue_contact_id` (`contact_id`)
  1484. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1485. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1486.  
  1487. -- --------------------------------------------------------
  1488.  
  1489. @@ -1246,7 +1169,7 @@
  1490. `time_stamp` datetime NOT NULL COMMENT 'When this reply event occurred.',
  1491. PRIMARY KEY (`id`),
  1492. KEY `FK_civicrm_mailing_event_reply_event_queue_id` (`event_queue_id`)
  1493. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1494. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1495.  
  1496. -- --------------------------------------------------------
  1497.  
  1498. @@ -1258,12 +1181,12 @@
  1499. `id` int(10) unsigned NOT NULL auto_increment,
  1500. `group_id` int(10) unsigned NOT NULL COMMENT 'FK to Group',
  1501. `contact_id` int(10) unsigned NOT NULL COMMENT 'FK to Contact',
  1502. - `hash` varchar(255) collate utf8_unicode_ci NOT NULL COMMENT 'Security hash',
  1503. + `hash` varchar(255) NOT NULL COMMENT 'Security hash',
  1504. `time_stamp` datetime NOT NULL COMMENT 'When this subscription event occurred.',
  1505. PRIMARY KEY (`id`),
  1506. KEY `FK_civicrm_mailing_event_subscribe_group_id` (`group_id`),
  1507. KEY `FK_civicrm_mailing_event_subscribe_contact_id` (`contact_id`)
  1508. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1509. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1510.  
  1511. -- --------------------------------------------------------
  1512.  
  1513. @@ -1279,7 +1202,7 @@
  1514. PRIMARY KEY (`id`),
  1515. KEY `FK_civicrm_mailing_event_trackable_url_open_event_queue_id` (`event_queue_id`),
  1516. KEY `FK_civicrm_mailing_event_trackable_url_open_trackable_url_id` (`trackable_url_id`)
  1517. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1518. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1519.  
  1520. -- --------------------------------------------------------
  1521.  
  1522. @@ -1294,7 +1217,7 @@
  1523. `time_stamp` datetime NOT NULL COMMENT 'When this delivery event occurred.',
  1524. PRIMARY KEY (`id`),
  1525. KEY `FK_civicrm_mailing_event_unsubscribe_event_queue_id` (`event_queue_id`)
  1526. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1527. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1528.  
  1529. -- --------------------------------------------------------
  1530.  
  1531. @@ -1305,12 +1228,12 @@
  1532. CREATE TABLE `civicrm_mailing_group` (
  1533. `id` int(10) unsigned NOT NULL auto_increment,
  1534. `mailing_id` int(10) unsigned NOT NULL COMMENT 'The ID of a previous mailing to include/exclude recipients.',
  1535. - `group_type` enum('Include','Exclude') collate utf8_unicode_ci default NULL COMMENT 'Are the members of the group included or excluded?.',
  1536. - `entity_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Name of table where item being referenced is stored.',
  1537. + `group_type` enum('Include','Exclude') default NULL COMMENT 'Are the members of the group included or excluded?.',
  1538. + `entity_table` varchar(64) NOT NULL COMMENT 'Name of table where item being referenced is stored.',
  1539. `entity_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to the referenced item.',
  1540. PRIMARY KEY (`id`),
  1541. KEY `FK_civicrm_mailing_group_mailing_id` (`mailing_id`)
  1542. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1543. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1544.  
  1545. -- --------------------------------------------------------
  1546.  
  1547. @@ -1324,11 +1247,11 @@
  1548. `scheduled_date` datetime default NULL COMMENT 'date on which this job was scheduled.',
  1549. `start_date` datetime default NULL COMMENT 'date on which this job was started.',
  1550. `end_date` datetime default NULL COMMENT 'date on which this job ended.',
  1551. - `status` enum('Scheduled','Running','Complete','Paused','Canceled') collate utf8_unicode_ci default NULL COMMENT 'The state of this job',
  1552. - `is_test` tinyint(4) default '0' COMMENT 'Is this job for a test mail?',
  1553. + `status` enum('Scheduled','Running','Complete','Paused','Canceled') default NULL COMMENT 'The state of this job',
  1554. + `is_test` tinyint(4) default NULL COMMENT 'Is this job for a test mail?',
  1555. PRIMARY KEY (`id`),
  1556. KEY `FK_civicrm_mailing_job_mailing_id` (`mailing_id`)
  1557. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1558. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1559.  
  1560. -- --------------------------------------------------------
  1561.  
  1562. @@ -1340,15 +1263,15 @@
  1563. `id` int(10) unsigned NOT NULL auto_increment,
  1564. `domain_id` int(10) unsigned NOT NULL COMMENT 'The ID of the civicrm domain.',
  1565. `job_id` int(10) unsigned NOT NULL COMMENT 'The ID of the Job .',
  1566. - `recipient_email` text collate utf8_unicode_ci COMMENT 'The email of the receipients this mail is to be sent.',
  1567. - `headers` text collate utf8_unicode_ci COMMENT 'The header information of this mailing .',
  1568. - `body` text collate utf8_unicode_ci COMMENT 'The body of this mailing.',
  1569. + `recipient_email` text COMMENT 'The email of the receipients this mail is to be sent.',
  1570. + `headers` text COMMENT 'The header information of this mailing .',
  1571. + `body` text COMMENT 'The body of this mailing.',
  1572. `added_at` datetime default NULL COMMENT 'date on which this job was added.',
  1573. `removed_at` datetime default NULL COMMENT 'date on which this job was removed.',
  1574. PRIMARY KEY (`id`),
  1575. KEY `FK_civicrm_mailing_spool_domain_id` (`domain_id`),
  1576. KEY `FK_civicrm_mailing_spool_job_id` (`job_id`)
  1577. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1578. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1579.  
  1580. -- --------------------------------------------------------
  1581.  
  1582. @@ -1358,11 +1281,11 @@
  1583.  
  1584. CREATE TABLE `civicrm_mailing_trackable_url` (
  1585. `id` int(10) unsigned NOT NULL auto_increment,
  1586. - `url` varchar(255) collate utf8_unicode_ci NOT NULL COMMENT 'The URL to be tracked.',
  1587. + `url` varchar(255) NOT NULL COMMENT 'The URL to be tracked.',
  1588. `mailing_id` int(10) unsigned NOT NULL COMMENT 'FK to the mailing',
  1589. PRIMARY KEY (`id`),
  1590. KEY `FK_civicrm_mailing_trackable_url_mailing_id` (`mailing_id`)
  1591. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1592. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1593.  
  1594. -- --------------------------------------------------------
  1595.  
  1596. @@ -1373,13 +1296,13 @@
  1597. CREATE TABLE `civicrm_mapping` (
  1598. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Mapping ID',
  1599. `domain_id` int(10) unsigned NOT NULL COMMENT 'Domain to which this mapping belongs',
  1600. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Name of Mapping',
  1601. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Description of Mapping.',
  1602. - `mapping_type` enum('Export','Import','Export Contributions','Import Contributions','Import Activity','Search Builder','Import Memberships','Import Participants') collate utf8_unicode_ci default NULL COMMENT 'Type of Mapping.',
  1603. + `name` varchar(64) default NULL COMMENT 'Name of Mapping',
  1604. + `description` varchar(255) default NULL COMMENT 'Description of Mapping.',
  1605. + `mapping_type` enum('Export','Import','Export Contributions','Import Contributions','Import Activity History','Search Builder','Import Memberships','Import Participants') default NULL COMMENT 'Type of Mapping.',
  1606. PRIMARY KEY (`id`),
  1607. KEY `UI_name` (`name`),
  1608. KEY `FK_civicrm_mapping_domain_id` (`domain_id`)
  1609. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1610. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1611.  
  1612. -- --------------------------------------------------------
  1613.  
  1614. @@ -1390,21 +1313,45 @@
  1615. CREATE TABLE `civicrm_mapping_field` (
  1616. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Mapping Field ID',
  1617. `mapping_id` int(10) unsigned NOT NULL COMMENT 'Mapping to which this field belongs',
  1618. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Mapping field key',
  1619. - `contact_type` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Contact Type in mapping',
  1620. + `name` varchar(64) default NULL COMMENT 'Mapping field key',
  1621. + `contact_type` varchar(64) default NULL COMMENT 'Contact Type in mapping',
  1622. `column_number` int(10) unsigned NOT NULL COMMENT 'Column number for mapping set',
  1623. `location_type_id` int(10) unsigned default NULL COMMENT 'Location type of this mapping, if required',
  1624. - `phone_type` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Phone type, if required',
  1625. + `phone_type` varchar(64) default NULL COMMENT 'Phone type, if required',
  1626. `relationship_type_id` int(10) unsigned default NULL COMMENT 'Relationship type, if required',
  1627. - `relationship_direction` varchar(6) collate utf8_unicode_ci default NULL,
  1628. + `relationship_direction` varchar(6) default NULL,
  1629. `grouping` int(10) unsigned default '1' COMMENT 'Used to group mapping_field records into related sets (e.g. for criteria sets in search builder mappings).',
  1630. - `operator` enum('=','!=','>','<','>=','<=','IN','NOT IN','LIKE','NOT LIKE') collate utf8_unicode_ci default NULL COMMENT 'SQL WHERE operator for search-builder mapping fields (search criteria).',
  1631. - `value` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'SQL WHERE value for search-builder mapping fields.',
  1632. + `operator` enum('=','!=','>','<','>=','<=','IN','NOT IN','LIKE','NOT LIKE') default NULL COMMENT 'SQL WHERE operator for search-builder mapping fields (search criteria).',
  1633. + `value` varchar(255) default NULL COMMENT 'SQL WHERE value for search-builder mapping fields.',
  1634. PRIMARY KEY (`id`),
  1635. KEY `FK_civicrm_mapping_field_mapping_id` (`mapping_id`),
  1636. KEY `FK_civicrm_mapping_field_location_type_id` (`location_type_id`),
  1637. KEY `FK_civicrm_mapping_field_relationship_type_id` (`relationship_type_id`)
  1638. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1639. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1640. +
  1641. +-- --------------------------------------------------------
  1642. +
  1643. +--
  1644. +-- Table structure for table `civicrm_meeting`
  1645. +--
  1646. +
  1647. +CREATE TABLE `civicrm_meeting` (
  1648. + `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Meeting ID',
  1649. + `source_contact_id` int(10) unsigned NOT NULL COMMENT 'Contact ID of person scheduling or logging this meeting. This will generally an authenticated user.',
  1650. + `target_entity_table` varchar(64) NOT NULL COMMENT 'Name of table where item being referenced is stored.',
  1651. + `target_entity_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to the referenced item.',
  1652. + `subject` varchar(64) default NULL COMMENT 'The subject/purpose of this meeting.',
  1653. + `scheduled_date_time` datetime default NULL COMMENT 'Date and time meeting is scheduled to occur.',
  1654. + `duration_hours` int(10) unsigned default NULL COMMENT 'Planned or actual duration of meeting - hours.',
  1655. + `duration_minutes` int(10) unsigned default NULL COMMENT 'Planned or actual duration of meeting - minutes.',
  1656. + `location` varchar(255) default NULL COMMENT 'Where will the meeting be held ?',
  1657. + `details` text COMMENT 'Details about the meeting (agenda, notes, etc).',
  1658. + `status` enum('Scheduled','Completed') default NULL COMMENT 'What is the status of this meeting? Completed meeting status results in activity history entry.',
  1659. + `parent_id` int(10) unsigned default NULL COMMENT 'Parent meeting ID (if this is a follow-up item). This is not currently implemented',
  1660. + PRIMARY KEY (`id`),
  1661. + KEY `FK_civicrm_meeting_source_contact_id` (`source_contact_id`),
  1662. + KEY `FK_civicrm_meeting_parent_id` (`parent_id`)
  1663. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1664.  
  1665. -- --------------------------------------------------------
  1666.  
  1667. @@ -1419,7 +1366,7 @@
  1668. `join_date` date default NULL COMMENT 'Beginning of initial membership period (member since...).',
  1669. `start_date` date default NULL COMMENT 'Beginning of current uninterrupted membership period.',
  1670. `end_date` date default NULL COMMENT 'Current membership period expire date.',
  1671. - `source` varchar(128) collate utf8_unicode_ci default NULL,
  1672. + `source` varchar(128) default NULL,
  1673. `status_id` int(10) unsigned NOT NULL COMMENT 'FK to Membership Status',
  1674. `is_override` tinyint(4) default NULL COMMENT 'Admin users may set a manual status which overrides the calculated status. When this flag is true, automated status update scripts should NOT modify status for the record.',
  1675. `reminder_date` date default NULL COMMENT 'When should a reminder be sent.',
  1676. @@ -1430,7 +1377,7 @@
  1677. KEY `FK_civicrm_membership_contact_id` (`contact_id`),
  1678. KEY `FK_civicrm_membership_membership_type_id` (`membership_type_id`),
  1679. KEY `FK_civicrm_membership_status_id` (`status_id`)
  1680. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=31 ;
  1681. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1682.  
  1683. -- --------------------------------------------------------
  1684.  
  1685. @@ -1440,22 +1387,22 @@
  1686.  
  1687. CREATE TABLE `civicrm_membership_block` (
  1688. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Membership Id',
  1689. - `entity_table` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Name for Membership Status',
  1690. + `entity_table` varchar(64) default NULL COMMENT 'Name for Membership Status',
  1691. `entity_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_contribution_page.id',
  1692. - `membership_types` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Membership types to be exposed by this block',
  1693. + `membership_types` varchar(255) default NULL COMMENT 'Membership types to be exposed by this block',
  1694. `membership_type_default` int(10) unsigned default NULL COMMENT 'Optional foreign key to membership_type',
  1695. `display_min_fee` tinyint(4) default '1' COMMENT 'Display minimum membership fee',
  1696. `is_separate_payment` tinyint(4) default '1' COMMENT 'Should membership transactions be processed separately',
  1697. - `new_title` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Title to display at top of block',
  1698. - `new_text` text collate utf8_unicode_ci COMMENT 'Text to display below title',
  1699. - `renewal_title` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Title for renewal',
  1700. - `renewal_text` text collate utf8_unicode_ci COMMENT 'Text to display for member renewal',
  1701. + `new_title` varchar(255) default NULL COMMENT 'Title to display at top of block',
  1702. + `new_text` text COMMENT 'Text to display below title',
  1703. + `renewal_title` varchar(255) default NULL COMMENT 'Title for renewal',
  1704. + `renewal_text` text COMMENT 'Text to display for member renewal',
  1705. `is_required` tinyint(4) default '0' COMMENT 'Is membership sign up optional',
  1706. `is_active` tinyint(4) default '1' COMMENT 'Is this membership_block enabled',
  1707. PRIMARY KEY (`id`),
  1708. KEY `FK_civicrm_membership_block_entity_id` (`entity_id`),
  1709. KEY `FK_civicrm_membership_block_membership_type_default` (`membership_type_default`)
  1710. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
  1711. +) TYPE=InnoDB AUTO_INCREMENT=2 ;
  1712.  
  1713. -- --------------------------------------------------------
  1714.  
  1715. @@ -1476,7 +1423,7 @@
  1716. KEY `FK_civicrm_membership_log_membership_id` (`membership_id`),
  1717. KEY `FK_civicrm_membership_log_status_id` (`status_id`),
  1718. KEY `FK_civicrm_membership_log_modified_id` (`modified_id`)
  1719. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=31 ;
  1720. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1721.  
  1722. -- --------------------------------------------------------
  1723.  
  1724. @@ -1487,11 +1434,12 @@
  1725. CREATE TABLE `civicrm_membership_payment` (
  1726. `id` int(10) unsigned NOT NULL auto_increment,
  1727. `membership_id` int(10) unsigned NOT NULL COMMENT 'FK to Membership table',
  1728. - `contribution_id` int(10) unsigned default NULL COMMENT 'FK to contribution table.',
  1729. + `payment_entity_table` varchar(128) default NULL COMMENT 'Table being referenced for payment entity.',
  1730. + `payment_entity_id` int(10) unsigned default NULL COMMENT 'FK to table with payment record (expected usage is civicrm_contribution).',
  1731. PRIMARY KEY (`id`),
  1732. - UNIQUE KEY `UI_contribution_membership` (`contribution_id`,`membership_id`),
  1733. + KEY `index_payment_entity` (`payment_entity_table`,`payment_entity_id`),
  1734. KEY `FK_civicrm_membership_payment_membership_id` (`membership_id`)
  1735. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1736. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1737.  
  1738. -- --------------------------------------------------------
  1739.  
  1740. @@ -1502,12 +1450,12 @@
  1741. CREATE TABLE `civicrm_membership_status` (
  1742. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Membership Id',
  1743. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this contact',
  1744. - `name` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Name for Membership Status',
  1745. - `start_event` enum('start_date','end_date','join_date') collate utf8_unicode_ci default NULL COMMENT 'Event when this status starts.',
  1746. - `start_event_adjust_unit` enum('day','month','year') collate utf8_unicode_ci default NULL COMMENT 'Unit used for adjusting from start_event.',
  1747. + `name` varchar(128) default NULL COMMENT 'Name for Membership Status',
  1748. + `start_event` enum('start_date','end_date','join_date') default NULL COMMENT 'Event when this status starts.',
  1749. + `start_event_adjust_unit` enum('day','month','year') default NULL COMMENT 'Unit used for adjusting from start_event.',
  1750. `start_event_adjust_interval` int(11) default NULL COMMENT 'Status range begins this many units from start_event.',
  1751. - `end_event` enum('start_date','end_date','join_date') collate utf8_unicode_ci default NULL COMMENT 'Event after which this status ends.',
  1752. - `end_event_adjust_unit` enum('day','month','year') collate utf8_unicode_ci default NULL COMMENT 'Unit used for adjusting from the ending event.',
  1753. + `end_event` enum('start_date','end_date','join_date') default NULL COMMENT 'Event after which this status ends.',
  1754. + `end_event_adjust_unit` enum('day','month','year') default NULL COMMENT 'Unit used for adjusting from the ending event.',
  1755. `end_event_adjust_interval` int(11) default NULL COMMENT 'Status range ends this many units from end_event.',
  1756. `is_current_member` tinyint(4) default NULL COMMENT 'Does this status aggregate to current members (e.g. New, Renewed, Grace might all be TRUE... while Unrenewed, Lapsed, Inactive would be FALSE).',
  1757. `is_admin` tinyint(4) default NULL COMMENT 'Is this status for admin/manual assignment only.',
  1758. @@ -1516,7 +1464,7 @@
  1759. `is_active` tinyint(4) default '1' COMMENT 'Is this membership_status enabled.',
  1760. PRIMARY KEY (`id`),
  1761. KEY `FK_civicrm_membership_status_domain_id` (`domain_id`)
  1762. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ;
  1763. +) TYPE=InnoDB AUTO_INCREMENT=5 ;
  1764.  
  1765. -- --------------------------------------------------------
  1766.  
  1767. @@ -1527,24 +1475,22 @@
  1768. CREATE TABLE `civicrm_membership_type` (
  1769. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Membership Id',
  1770. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this contact',
  1771. - `name` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Name of Membership Type',
  1772. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Description of Membership Type',
  1773. + `name` varchar(128) default NULL COMMENT 'Name of Membership Type',
  1774. + `description` varchar(255) default NULL COMMENT 'Description of Membership Type',
  1775. `member_of_contact_id` int(10) unsigned NOT NULL COMMENT 'Owner organization for this membership type. FK to Contact ID',
  1776. `contribution_type_id` int(10) unsigned NOT NULL COMMENT 'If membership is paid by a contribution - what contribution type should be used. FK to Contribution Type ID',
  1777. `minimum_fee` decimal(20,2) default '0.00' COMMENT 'Minimum fee for this membership (0 for free/complimentary memberships).',
  1778. - `duration_unit` enum('day','month','year','lifetime') collate utf8_unicode_ci default NULL COMMENT 'Unit in which membership period is expressed.',
  1779. + `duration_unit` enum('day','month','year','lifetime') default NULL COMMENT 'Unit in which membership period is expressed.',
  1780. `duration_interval` int(11) default NULL COMMENT 'Number of duration units in membership period (e.g. 1 year, 12 months).',
  1781. - `period_type` enum('rolling','fixed') collate utf8_unicode_ci default NULL COMMENT 'Rolling membership period starts on signup date. Fixed membership periods start on fixed_period_start_day.',
  1782. + `period_type` enum('rolling','fixed') default NULL COMMENT 'Rolling membership period starts on signup date. Fixed membership periods start on fixed_period_start_day.',
  1783. `fixed_period_start_day` int(11) default NULL COMMENT 'For fixed period memberships, month and day (mmdd) on which subscription/membership will start. Period start is back-dated unless after rollover day.',
  1784. `fixed_period_rollover_day` int(11) default NULL COMMENT 'For fixed period memberships, signups after this day (mmdd) rollover to next period.',
  1785. `relationship_type_id` int(10) unsigned default NULL COMMENT 'FK to Relationship Type ID',
  1786. - `relationship_direction` varchar(6) collate utf8_unicode_ci default NULL,
  1787. - `visibility` varchar(64) collate utf8_unicode_ci default NULL,
  1788. + `relationship_direction` varchar(6) default NULL,
  1789. + `visibility` varchar(64) default NULL,
  1790. `weight` int(11) default NULL,
  1791. `renewal_msg_id` int(10) unsigned default NULL COMMENT 'FK to civicrm_msg_template.id',
  1792. `renewal_reminder_day` int(11) default NULL COMMENT 'Number of days prior to expiration to send renewal reminder',
  1793. - `receipt_text_signup` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Receipt Text for membership signup',
  1794. - `receipt_text_renewal` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Receipt Text for membership renewal',
  1795. `is_active` tinyint(4) default '1' COMMENT 'Is this membership_type enabled',
  1796. PRIMARY KEY (`id`),
  1797. KEY `FK_civicrm_membership_type_domain_id` (`domain_id`),
  1798. @@ -1552,7 +1498,7 @@
  1799. KEY `FK_civicrm_membership_type_contribution_type_id` (`contribution_type_id`),
  1800. KEY `FK_civicrm_membership_type_relationship_type_id` (`relationship_type_id`),
  1801. KEY `FK_civicrm_membership_type_renewal_msg_id` (`renewal_msg_id`)
  1802. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;
  1803. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1804.  
  1805. -- --------------------------------------------------------
  1806.  
  1807. @@ -1563,14 +1509,14 @@
  1808. CREATE TABLE `civicrm_msg_template` (
  1809. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Message Template ID',
  1810. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this contact',
  1811. - `msg_title` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Descriptive title of message',
  1812. - `msg_subject` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Subject for email message.',
  1813. - `msg_text` text collate utf8_unicode_ci COMMENT 'Text formatted message',
  1814. - `msg_html` text collate utf8_unicode_ci COMMENT 'HTML formatted message',
  1815. + `msg_title` varchar(255) default NULL COMMENT 'Descriptive title of message',
  1816. + `msg_subject` varchar(255) default NULL COMMENT 'Subject for email message.',
  1817. + `msg_text` text COMMENT 'Text formatted message',
  1818. + `msg_html` text COMMENT 'HTML formatted message',
  1819. `is_active` tinyint(4) default '1',
  1820. PRIMARY KEY (`id`),
  1821. KEY `FK_civicrm_msg_template_domain_id` (`domain_id`)
  1822. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1823. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1824.  
  1825. -- --------------------------------------------------------
  1826.  
  1827. @@ -1580,68 +1526,16 @@
  1828.  
  1829. CREATE TABLE `civicrm_note` (
  1830. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Note ID',
  1831. - `entity_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Name of table where item being referenced is stored.',
  1832. + `entity_table` varchar(64) NOT NULL COMMENT 'Name of table where item being referenced is stored.',
  1833. `entity_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to the referenced item.',
  1834. - `note` text collate utf8_unicode_ci COMMENT 'Note and/or Comment.',
  1835. + `note` text COMMENT 'Note and/or Comment.',
  1836. `contact_id` int(10) unsigned NOT NULL COMMENT 'FK to Contact ID creator',
  1837. `modified_date` date default NULL COMMENT 'When was this note last modified/edited',
  1838. - `subject` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'subject of note description',
  1839. + `subject` varchar(255) default NULL COMMENT 'subject of note description',
  1840. PRIMARY KEY (`id`),
  1841. KEY `index_entity` (`entity_table`,`entity_id`),
  1842. KEY `FK_civicrm_note_contact_id` (`contact_id`)
  1843. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=98 ;
  1844. -
  1845. --- --------------------------------------------------------
  1846. -
  1847. ---
  1848. --- Table structure for table `civicrm_openid`
  1849. ---
  1850. -
  1851. -CREATE TABLE `civicrm_openid` (
  1852. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique OpenID ID',
  1853. - `contact_id` int(10) unsigned default NULL COMMENT 'FK to Contact ID',
  1854. - `location_type_id` int(10) unsigned default NULL COMMENT 'Which Location does this email belong to.',
  1855. - `openid` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM',
  1856. - `allowed_to_login` tinyint(4) NOT NULL default '0' COMMENT 'Whether or not this user is allowed to login',
  1857. - `is_primary` tinyint(4) default '0' COMMENT 'Is this the primary email for this contact and location.',
  1858. - PRIMARY KEY (`id`),
  1859. - KEY `index_location_type` (`location_type_id`),
  1860. - KEY `UI_openid` (`openid`),
  1861. - KEY `FK_civicrm_openid_contact_id` (`contact_id`)
  1862. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1863. -
  1864. --- --------------------------------------------------------
  1865. -
  1866. ---
  1867. --- Table structure for table `civicrm_openid_associations`
  1868. ---
  1869. -
  1870. -CREATE TABLE `civicrm_openid_associations` (
  1871. - `id` int(10) unsigned NOT NULL auto_increment,
  1872. - `server_url` blob,
  1873. - `handle` varchar(255) collate utf8_unicode_ci default NULL,
  1874. - `secret` blob,
  1875. - `issued` int(11) default NULL,
  1876. - `lifetime` int(11) default NULL,
  1877. - `assoc_type` varchar(64) collate utf8_unicode_ci default NULL,
  1878. - PRIMARY KEY (`id`),
  1879. - UNIQUE KEY `server_url_handle_index` (`server_url`(166),`handle`(166))
  1880. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1881. -
  1882. --- --------------------------------------------------------
  1883. -
  1884. ---
  1885. --- Table structure for table `civicrm_openid_nonces`
  1886. ---
  1887. -
  1888. -CREATE TABLE `civicrm_openid_nonces` (
  1889. - `id` int(10) unsigned NOT NULL auto_increment,
  1890. - `server_url` blob,
  1891. - `timestamp` int(11) default NULL,
  1892. - `salt` char(40) collate utf8_unicode_ci default NULL,
  1893. - PRIMARY KEY (`id`),
  1894. - UNIQUE KEY `nonce_index` (`server_url`(255),`timestamp`,`salt`)
  1895. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  1896. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  1897.  
  1898. -- --------------------------------------------------------
  1899.  
  1900. @@ -1652,15 +1546,15 @@
  1901. CREATE TABLE `civicrm_option_group` (
  1902. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Option Group ID',
  1903. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which domain owns this group of options.',
  1904. - `name` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Option group name. Used as selection key by class properties which lookup options in civicrm_option_value.',
  1905. - `label` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Option label.',
  1906. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Option group description.',
  1907. + `name` varchar(64) NOT NULL COMMENT 'Option group name. Used as selection key by class properties which lookup options in civicrm_option_value.',
  1908. + `label` varchar(255) default NULL COMMENT 'Option label.',
  1909. + `description` varchar(255) default NULL COMMENT 'Option group description.',
  1910. `is_reserved` tinyint(4) default NULL COMMENT 'Is this a predefined system option group (i.e. it can not be deleted)?',
  1911. `is_active` tinyint(4) default NULL COMMENT 'Is this option group active?',
  1912. PRIMARY KEY (`id`),
  1913. UNIQUE KEY `option_group_name_domain_id` (`name`,`domain_id`),
  1914. KEY `FK_civicrm_option_group_domain_id` (`domain_id`)
  1915. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=37 ;
  1916. +) TYPE=InnoDB AUTO_INCREMENT=21 ;
  1917.  
  1918. -- --------------------------------------------------------
  1919.  
  1920. @@ -1671,23 +1565,40 @@
  1921. CREATE TABLE `civicrm_option_value` (
  1922. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Option ID',
  1923. `option_group_id` int(10) unsigned NOT NULL COMMENT 'Group which this option belongs to.',
  1924. - `label` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Option string as displayed to users - e.g. the label in an HTML OPTION tag.',
  1925. - `value` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'The actual value stored (as a foreign key) in the data record. Functions which need lookup option_value.title should use civicrm_option_value.option_group_id plus civicrm_option_value.value as the key.',
  1926. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'May be used to store an option string that is different from the display title. One use case is when a non-translated value needs to be set / sent to another application (e.g. for Credit Card type).',
  1927. - `grouping` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Use to sort and/or set display properties for sub-set(s) of options within an option group. EXAMPLE: Use for college_interest field, to differentiate partners from non-partners.',
  1928. + `label` varchar(64) NOT NULL COMMENT 'Option string as displayed to users - e.g. the label in an HTML OPTION tag.',
  1929. + `value` int(10) unsigned NOT NULL COMMENT 'The actual value stored (as a foreign key) in the data record. Functions which need lookup option_value.title should use civicrm_option_value.option_group_id plus civicrm_option_value.value as the key.',
  1930. + `name` varchar(64) default NULL COMMENT 'May be used to store an option string that is different from the display title. One use case is when a non-translated value needs to be set / sent to another application (e.g. for Credit Card type).',
  1931. + `grouping` varchar(64) default NULL COMMENT 'Use to sort and/or set display properties for sub-set(s) of options within an option group. EXAMPLE: Use for college_interest field, to differentiate partners from non-partners.',
  1932. `filter` int(10) unsigned default NULL COMMENT 'Bitwise logic can be used to create subsets of options within an option_group for different uses.',
  1933. `is_default` tinyint(4) default '0' COMMENT 'Is this the default option for the group?',
  1934. `weight` int(10) unsigned NOT NULL COMMENT 'Controls display sort order.',
  1935. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Optional description.',
  1936. + `description` varchar(255) default NULL COMMENT 'Optional description.',
  1937. `is_optgroup` tinyint(4) default '0' COMMENT 'Is this row simply a display header? Expected usage is to render these as OPTGROUP tags within a SELECT field list of options?',
  1938. `is_reserved` tinyint(4) default '0' COMMENT 'Is this a predefined system object?',
  1939. `is_active` tinyint(4) default '1' COMMENT 'Is this option active?',
  1940. - `component_id` int(10) unsigned default NULL COMMENT 'Component that this option value belongs/caters to.',
  1941. PRIMARY KEY (`id`),
  1942. KEY `index_option_group_id_value` (`value`,`option_group_id`),
  1943. - KEY `FK_civicrm_option_value_option_group_id` (`option_group_id`),
  1944. - KEY `FK_civicrm_option_value_component_id` (`component_id`)
  1945. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=176 ;
  1946. + KEY `FK_civicrm_option_value_option_group_id` (`option_group_id`)
  1947. +) TYPE=InnoDB AUTO_INCREMENT=105 ;
  1948. +
  1949. +-- --------------------------------------------------------
  1950. +
  1951. +--
  1952. +-- Table structure for table `civicrm_organization`
  1953. +--
  1954. +
  1955. +CREATE TABLE `civicrm_organization` (
  1956. + `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Organization ID',
  1957. + `contact_id` int(10) unsigned NOT NULL COMMENT 'FK to Contact ID',
  1958. + `organization_name` varchar(128) default NULL COMMENT 'Organization Name.',
  1959. + `legal_name` varchar(128) default NULL COMMENT 'Legal Name.',
  1960. + `sic_code` varchar(8) default NULL COMMENT 'Standard Industry Classification Code.',
  1961. + `primary_contact_id` int(10) unsigned default NULL COMMENT 'Optional FK to Primary Contact for this organization.',
  1962. + PRIMARY KEY (`id`),
  1963. + UNIQUE KEY `UI_contact` (`contact_id`),
  1964. + KEY `index_organization_name` (`organization_name`),
  1965. + KEY `FK_civicrm_organization_primary_contact_id` (`primary_contact_id`)
  1966. +) TYPE=InnoDB AUTO_INCREMENT=55 ;
  1967.  
  1968. -- --------------------------------------------------------
  1969.  
  1970. @@ -1702,15 +1613,15 @@
  1971. `status_id` int(10) unsigned default '1' COMMENT 'Participant status ID. Implicit FK to civicrm_option_value where option_group = participant_status. Default of 1 should map to status = Registered.',
  1972. `role_id` int(10) unsigned default NULL COMMENT 'Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.',
  1973. `register_date` datetime default NULL COMMENT 'When did contact register for event?',
  1974. - `source` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Source of this event registration.',
  1975. - `event_level` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that we store the label value and not the key',
  1976. + `source` varchar(128) default NULL COMMENT 'Source of this event registration.',
  1977. + `event_level` varchar(255) default NULL COMMENT 'Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that we store the label value and not the key',
  1978. `is_test` tinyint(4) default '0',
  1979. PRIMARY KEY (`id`),
  1980. KEY `index_status_id` (`status_id`),
  1981. KEY `index_role_id` (`role_id`),
  1982. KEY `FK_civicrm_participant_contact_id` (`contact_id`),
  1983. KEY `FK_civicrm_participant_event_id` (`event_id`)
  1984. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=51 ;
  1985. +) TYPE=InnoDB AUTO_INCREMENT=73 ;
  1986.  
  1987. -- --------------------------------------------------------
  1988.  
  1989. @@ -1721,11 +1632,11 @@
  1990. CREATE TABLE `civicrm_participant_payment` (
  1991. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Participant Payment Id',
  1992. `participant_id` int(10) unsigned NOT NULL COMMENT 'Participant Id (FK)',
  1993. - `contribution_id` int(10) unsigned NOT NULL COMMENT 'FK to contribution table.',
  1994. + `payment_entity_table` varchar(128) default NULL COMMENT 'Table being referenced for payment entity (expected usage is civicrm_contribution).',
  1995. + `payment_entity_id` int(10) unsigned NOT NULL COMMENT 'FK to table with payment record (e.g. civicrm_contribution.id).',
  1996. PRIMARY KEY (`id`),
  1997. - UNIQUE KEY `UI_contribution_participant` (`contribution_id`,`participant_id`),
  1998. KEY `FK_civicrm_participant_payment_participant_id` (`participant_id`)
  1999. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  2000. +) TYPE=InnoDB AUTO_INCREMENT=73 ;
  2001.  
  2002. -- --------------------------------------------------------
  2003.  
  2004. @@ -1736,27 +1647,26 @@
  2005. CREATE TABLE `civicrm_payment_processor` (
  2006. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Payment Processor ID',
  2007. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this payment processor.',
  2008. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Payment Processor Name.',
  2009. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Payment Processor Description.',
  2010. - `payment_processor_type` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Payment Processor Type.',
  2011. + `name` varchar(64) default NULL COMMENT 'Payment Processor Name.',
  2012. + `description` varchar(255) default NULL COMMENT 'Payment Processor Description.',
  2013. + `payment_processor_type` varchar(255) default NULL COMMENT 'Payment Processor Type.',
  2014. `is_active` tinyint(4) default NULL COMMENT 'Is this processor active?',
  2015. `is_default` tinyint(4) default NULL COMMENT 'Is this processor the default?',
  2016. `is_test` tinyint(4) default NULL COMMENT 'Is this processor for a test site?',
  2017. - `user_name` varchar(255) collate utf8_unicode_ci default NULL,
  2018. - `password` varchar(255) collate utf8_unicode_ci default NULL,
  2019. - `signature` varchar(255) collate utf8_unicode_ci default NULL,
  2020. - `url_site` varchar(255) collate utf8_unicode_ci default NULL,
  2021. - `url_api` varchar(255) collate utf8_unicode_ci default NULL,
  2022. - `url_recur` varchar(255) collate utf8_unicode_ci default NULL,
  2023. - `url_button` varchar(255) collate utf8_unicode_ci default NULL,
  2024. - `subject` varchar(255) collate utf8_unicode_ci default NULL,
  2025. - `class_name` varchar(255) collate utf8_unicode_ci default NULL,
  2026. + `user_name` varchar(255) default NULL,
  2027. + `password` varchar(255) default NULL,
  2028. + `signature` varchar(255) default NULL,
  2029. + `url_site` varchar(255) default NULL,
  2030. + `url_recur` varchar(255) default NULL,
  2031. + `url_button` varchar(255) default NULL,
  2032. + `subject` varchar(255) default NULL,
  2033. + `class_name` varchar(255) default NULL,
  2034. `billing_mode` int(10) unsigned NOT NULL COMMENT 'Billing Mode',
  2035. `is_recur` tinyint(4) default NULL COMMENT 'Can process recurring contributions',
  2036. PRIMARY KEY (`id`),
  2037. UNIQUE KEY `UI_name_test` (`name`,`is_test`),
  2038. KEY `FK_civicrm_payment_processor_domain_id` (`domain_id`)
  2039. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  2040. +) TYPE=InnoDB AUTO_INCREMENT=3 ;
  2041.  
  2042. -- --------------------------------------------------------
  2043.  
  2044. @@ -1767,30 +1677,28 @@
  2045. CREATE TABLE `civicrm_payment_processor_type` (
  2046. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Payment Processor Type ID',
  2047. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this payment processor.',
  2048. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Payment Processor Name.',
  2049. - `title` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Payment Processor Name.',
  2050. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Payment Processor Description.',
  2051. + `name` varchar(64) default NULL COMMENT 'Payment Processor Name.',
  2052. + `title` varchar(64) default NULL COMMENT 'Payment Processor Name.',
  2053. + `description` varchar(255) default NULL COMMENT 'Payment Processor Description.',
  2054. `is_active` tinyint(4) default NULL COMMENT 'Is this processor active?',
  2055. `is_default` tinyint(4) default NULL COMMENT 'Is this processor the default?',
  2056. - `user_name_label` varchar(255) collate utf8_unicode_ci default NULL,
  2057. - `password_label` varchar(255) collate utf8_unicode_ci default NULL,
  2058. - `signature_label` varchar(255) collate utf8_unicode_ci default NULL,
  2059. - `subject_label` varchar(255) collate utf8_unicode_ci default NULL,
  2060. - `class_name` varchar(255) collate utf8_unicode_ci default NULL,
  2061. - `url_site_default` varchar(255) collate utf8_unicode_ci default NULL,
  2062. - `url_api_default` varchar(255) collate utf8_unicode_ci default NULL,
  2063. - `url_recur_default` varchar(255) collate utf8_unicode_ci default NULL,
  2064. - `url_button_default` varchar(255) collate utf8_unicode_ci default NULL,
  2065. - `url_site_test_default` varchar(255) collate utf8_unicode_ci default NULL,
  2066. - `url_api_test_default` varchar(255) collate utf8_unicode_ci default NULL,
  2067. - `url_recur_test_default` varchar(255) collate utf8_unicode_ci default NULL,
  2068. - `url_button_test_default` varchar(255) collate utf8_unicode_ci default NULL,
  2069. + `user_name_label` varchar(255) default NULL,
  2070. + `password_label` varchar(255) default NULL,
  2071. + `signature_label` varchar(255) default NULL,
  2072. + `subject_label` varchar(255) default NULL,
  2073. + `class_name` varchar(255) default NULL,
  2074. + `url_site_default` varchar(255) default NULL,
  2075. + `url_recur_default` varchar(255) default NULL,
  2076. + `url_button_default` varchar(255) default NULL,
  2077. + `url_site_test_default` varchar(255) default NULL,
  2078. + `url_recur_test_default` varchar(255) default NULL,
  2079. + `url_button_test_default` varchar(255) default NULL,
  2080. `billing_mode` int(10) unsigned NOT NULL COMMENT 'Billing Mode',
  2081. `is_recur` tinyint(4) default NULL COMMENT 'Can process recurring contributions',
  2082. PRIMARY KEY (`id`),
  2083. UNIQUE KEY `UI_name_domain_id` (`name`,`domain_id`),
  2084. KEY `FK_civicrm_payment_processor_type_domain_id` (`domain_id`)
  2085. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=9 ;
  2086. +) TYPE=InnoDB AUTO_INCREMENT=9 ;
  2087.  
  2088. -- --------------------------------------------------------
  2089.  
  2090. @@ -1800,20 +1708,41 @@
  2091.  
  2092. CREATE TABLE `civicrm_phone` (
  2093. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Phone ID',
  2094. - `contact_id` int(10) unsigned default NULL COMMENT 'FK to Contact ID',
  2095. - `location_type_id` int(10) unsigned default NULL COMMENT 'Which Location does this phone belong to.',
  2096. + `location_id` int(10) unsigned NOT NULL COMMENT 'Which Location does this phone belong to.',
  2097. `is_primary` tinyint(4) default '0' COMMENT 'Is this the primary phone for this contact and location.',
  2098. - `is_billing` tinyint(4) default '0' COMMENT 'Is this the billing?',
  2099. `mobile_provider_id` int(10) unsigned default NULL COMMENT 'Which Mobile Provider does this phone belong to.',
  2100. - `phone` varchar(32) collate utf8_unicode_ci default NULL COMMENT 'Complete phone number.',
  2101. - `phone_type` enum('Phone','Mobile','Fax','Pager') collate utf8_unicode_ci default NULL COMMENT 'What type of telecom device is this.',
  2102. + `phone` varchar(32) default NULL COMMENT 'Complete phone number.',
  2103. + `phone_type` enum('Phone','Mobile','Fax','Pager') default NULL COMMENT 'What type of telecom device is this.',
  2104. PRIMARY KEY (`id`),
  2105. - KEY `index_location_type` (`location_type_id`),
  2106. - KEY `index_is_primary` (`is_primary`),
  2107. - KEY `index_is_billing` (`is_billing`),
  2108. KEY `UI_mobile_provider_id` (`mobile_provider_id`),
  2109. - KEY `FK_civicrm_phone_contact_id` (`contact_id`)
  2110. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=121 ;
  2111. + KEY `FK_civicrm_phone_location_id` (`location_id`)
  2112. +) TYPE=InnoDB AUTO_INCREMENT=16 ;
  2113. +
  2114. +-- --------------------------------------------------------
  2115. +
  2116. +--
  2117. +-- Table structure for table `civicrm_phonecall`
  2118. +--
  2119. +
  2120. +CREATE TABLE `civicrm_phonecall` (
  2121. + `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Phone call ID',
  2122. + `source_contact_id` int(10) unsigned NOT NULL COMMENT 'Contact ID of person making the call. This will generally an authenticated user.',
  2123. + `target_entity_table` varchar(64) NOT NULL COMMENT 'Name of table where item being referenced is stored.',
  2124. + `target_entity_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to the referenced item.',
  2125. + `subject` varchar(64) default NULL COMMENT 'Short description of the subject of this call.',
  2126. + `scheduled_date_time` datetime default NULL COMMENT 'Date and time phonecall is scheduled to be made.',
  2127. + `duration_hours` int(10) unsigned default NULL COMMENT 'Planned or actual duration of call - hours.',
  2128. + `duration_minutes` int(10) unsigned default NULL COMMENT 'Planned or actual duration of call - minutes.',
  2129. + `phone_id` int(10) unsigned default NULL COMMENT 'Phone ID of the number called (optional - used if an existing phone number is selected).',
  2130. + `phone_number` varchar(64) default NULL COMMENT 'Phone number in case the number does not exist in the civicrm_phone table.',
  2131. + `details` text COMMENT 'Details about the call.',
  2132. + `status` enum('Scheduled','Left Message','Unreachable','Completed') default NULL COMMENT 'What is the status of this phone call? Completed calls result in activity history entry.',
  2133. + `parent_id` int(10) unsigned default NULL COMMENT 'Parent phone call ID (if this is a follow-up item). This is not currently implemented',
  2134. + PRIMARY KEY (`id`),
  2135. + KEY `FK_civicrm_phonecall_source_contact_id` (`source_contact_id`),
  2136. + KEY `FK_civicrm_phonecall_phone_id` (`phone_id`),
  2137. + KEY `FK_civicrm_phonecall_parent_id` (`parent_id`)
  2138. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  2139.  
  2140. -- --------------------------------------------------------
  2141.  
  2142. @@ -1827,17 +1756,17 @@
  2143. `contact_id` int(10) unsigned default NULL COMMENT 'FK to Contact ID',
  2144. `is_domain` tinyint(4) default NULL COMMENT 'Is this the record for the domain setting?',
  2145. `location_count` int(10) unsigned default NULL COMMENT 'Number of locations to be displayed on edit page?',
  2146. - `contact_view_options` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'What tabs are displayed in the contact summary',
  2147. - `contact_edit_options` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'What tabs are displayed in the contact edit',
  2148. - `advanced_search_options` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'What tabs are displayed in the advanced search screen',
  2149. - `user_dashboard_options` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'What tabs are displayed in the contact edit',
  2150. - `address_options` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'What fields are displayed from the address table',
  2151. - `address_format` text collate utf8_unicode_ci COMMENT 'Format to display the address',
  2152. - `mailing_format` text collate utf8_unicode_ci COMMENT 'Format to display a mailing label',
  2153. - `individual_name_format` text collate utf8_unicode_ci COMMENT 'Format to display a individual name',
  2154. - `address_standardization_provider` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'object name of provider for address standarization',
  2155. - `address_standardization_userid` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'user id for provider login',
  2156. - `address_standardization_url` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'url of address standardization service',
  2157. + `contact_view_options` varchar(128) default NULL COMMENT 'What tabs are displayed in the contact summary',
  2158. + `contact_edit_options` varchar(128) default NULL COMMENT 'What tabs are displayed in the contact edit',
  2159. + `advanced_search_options` varchar(128) default NULL COMMENT 'What tabs are displayed in the advanced search screen',
  2160. + `user_dashboard_options` varchar(128) default NULL COMMENT 'What tabs are displayed in the contact edit',
  2161. + `address_options` varchar(128) default NULL COMMENT 'What fields are displayed from the address table',
  2162. + `address_format` text COMMENT 'Format to display the address',
  2163. + `mailing_format` text COMMENT 'Format to display a mailing label',
  2164. + `individual_name_format` text COMMENT 'Format to display a individual name',
  2165. + `address_standardization_provider` varchar(64) default NULL COMMENT 'object name of provider for address standarization',
  2166. + `address_standardization_userid` varchar(64) default NULL COMMENT 'user id for provider login',
  2167. + `address_standardization_url` varchar(255) default NULL COMMENT 'url of address standardization service',
  2168. PRIMARY KEY (`id`),
  2169. KEY `index_contact_view_options` (`contact_view_options`),
  2170. KEY `index_contact_edit_options` (`contact_edit_options`),
  2171. @@ -1846,27 +1775,7 @@
  2172. KEY `index_address_options` (`address_options`),
  2173. KEY `FK_civicrm_preferences_domain_id` (`domain_id`),
  2174. KEY `FK_civicrm_preferences_contact_id` (`contact_id`)
  2175. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
  2176. -
  2177. --- --------------------------------------------------------
  2178. -
  2179. ---
  2180. --- Table structure for table `civicrm_preferences_date`
  2181. ---
  2182. -
  2183. -CREATE TABLE `civicrm_preferences_date` (
  2184. - `id` int(10) unsigned NOT NULL auto_increment,
  2185. - `domain_id` int(10) unsigned NOT NULL,
  2186. - `name` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'The meta name for this date (fixed in code)',
  2187. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Description of this date type.',
  2188. - `start` int(11) NOT NULL COMMENT 'The start offset relative to current year',
  2189. - `end` int(11) NOT NULL COMMENT 'The end offset relative to current year, can be negative',
  2190. - `minute_increment` int(11) default NULL COMMENT 'The minute increment number',
  2191. - `format` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'The date type',
  2192. - PRIMARY KEY (`id`),
  2193. - KEY `index_name` (`name`),
  2194. - KEY `FK_civicrm_preferences_date_domain_id` (`domain_id`)
  2195. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=12 ;
  2196. +) TYPE=InnoDB AUTO_INCREMENT=2 ;
  2197.  
  2198. -- --------------------------------------------------------
  2199.  
  2200. @@ -1876,16 +1785,16 @@
  2201.  
  2202. CREATE TABLE `civicrm_premiums` (
  2203. `id` int(10) unsigned NOT NULL auto_increment,
  2204. - `entity_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Joins these premium settings to another object. Always civicrm_contribution_page for now.',
  2205. + `entity_table` varchar(64) NOT NULL COMMENT 'Joins these premium settings to another object. Always civicrm_contribution_page for now.',
  2206. `entity_id` int(10) unsigned NOT NULL,
  2207. `premiums_active` tinyint(4) NOT NULL default '0' COMMENT 'Is the Premiums feature enabled for this page?',
  2208. - `premiums_intro_title` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Title for Premiums section.',
  2209. - `premiums_intro_text` text collate utf8_unicode_ci COMMENT 'Displayed in <div> at top of Premiums section of page. Text and HTML allowed.',
  2210. - `premiums_contact_email` varchar(100) collate utf8_unicode_ci default NULL COMMENT 'This email address is included in receipts if it is populated and a premium has been selected.',
  2211. - `premiums_contact_phone` varchar(50) collate utf8_unicode_ci default NULL COMMENT 'This phone number is included in receipts if it is populated and a premium has been selected.',
  2212. + `premiums_intro_title` varchar(255) default NULL COMMENT 'Title for Premiums section.',
  2213. + `premiums_intro_text` text COMMENT 'Displayed in <div> at top of Premiums section of page. Text and HTML allowed.',
  2214. + `premiums_contact_email` varchar(100) default NULL COMMENT 'This email address is included in receipts if it is populated and a premium has been selected.',
  2215. + `premiums_contact_phone` varchar(50) default NULL COMMENT 'This phone number is included in receipts if it is populated and a premium has been selected.',
  2216. `premiums_display_min_contribution` tinyint(4) NOT NULL COMMENT 'Boolean. Should we automatically display minimum contribution amount text after the premium descriptions.',
  2217. PRIMARY KEY (`id`)
  2218. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
  2219. +) TYPE=InnoDB AUTO_INCREMENT=2 ;
  2220.  
  2221. -- --------------------------------------------------------
  2222.  
  2223. @@ -1897,11 +1806,11 @@
  2224. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Contribution ID',
  2225. `premiums_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to premiums settings record.',
  2226. `product_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to each product object.',
  2227. - `weight` int(10) unsigned NOT NULL,
  2228. + `sort_position` int(10) unsigned NOT NULL,
  2229. PRIMARY KEY (`id`),
  2230. KEY `FK_civicrm_premiums_product_premiums_id` (`premiums_id`),
  2231. KEY `FK_civicrm_premiums_product_product_id` (`product_id`)
  2232. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
  2233. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  2234.  
  2235. -- --------------------------------------------------------
  2236.  
  2237. @@ -1912,12 +1821,12 @@
  2238. CREATE TABLE `civicrm_price_field` (
  2239. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Price Field',
  2240. `price_set_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_price_set',
  2241. - `name` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Variable name/programmatic handle for this field',
  2242. - `label` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Text for form field label (also friendly name for administering this field)',
  2243. - `html_type` enum('Text','Select','Radio','CheckBox') collate utf8_unicode_ci NOT NULL,
  2244. + `name` varchar(64) NOT NULL COMMENT 'Variable name/programmatic handle for this field',
  2245. + `label` varchar(64) NOT NULL COMMENT 'Text for form field label (also friendly name for administering this field)',
  2246. + `html_type` enum('Text','Select','Radio','CheckBox') NOT NULL,
  2247. `is_enter_qty` tinyint(4) default '0' COMMENT 'Enter a quantity for this field?',
  2248. - `help_pre` text collate utf8_unicode_ci COMMENT 'Description and/or help text to display before this field.',
  2249. - `help_post` text collate utf8_unicode_ci COMMENT 'Description and/or help text to display after this field.',
  2250. + `help_pre` text COMMENT 'Description and/or help text to display before this field.',
  2251. + `help_post` text COMMENT 'Description and/or help text to display after this field.',
  2252. `weight` int(11) default '1' COMMENT 'Order in which the fields should appear',
  2253. `is_display_amounts` tinyint(4) default '1' COMMENT 'Should the price be displayed next to the label for each option?',
  2254. `options_per_line` int(10) unsigned default '1' COMMENT 'number of options per line for checkbox and radio',
  2255. @@ -1925,11 +1834,11 @@
  2256. `is_required` tinyint(4) default '1' COMMENT 'Is this price field required (value must be > 1)',
  2257. `active_on` datetime default '0000-00-00 00:00:00' COMMENT 'If non-zero, do not show this field before the date specified',
  2258. `expire_on` datetime default '0000-00-00 00:00:00' COMMENT 'If non-zero, do not show this field after the date specified',
  2259. - `javascript` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Optional scripting attributes for field',
  2260. + `javascript` varchar(255) default NULL COMMENT 'Optional scripting attributes for field',
  2261. PRIMARY KEY (`id`),
  2262. KEY `index_name` (`name`),
  2263. KEY `FK_civicrm_price_field_price_set_id` (`price_set_id`)
  2264. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  2265. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  2266.  
  2267. -- --------------------------------------------------------
  2268.  
  2269. @@ -1940,17 +1849,17 @@
  2270. CREATE TABLE `civicrm_price_set` (
  2271. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Price Set',
  2272. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which domain owns this price set',
  2273. - `name` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Variable name/programmatic handle for this group',
  2274. - `title` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Friendly name',
  2275. + `name` varchar(64) NOT NULL COMMENT 'Variable name/programmatic handle for this group',
  2276. + `title` varchar(64) NOT NULL COMMENT 'Friendly name',
  2277. `is_active` tinyint(4) default '1' COMMENT 'Is this price set active',
  2278. - `help_pre` text collate utf8_unicode_ci COMMENT 'Description and/or help text to display before fields in form.',
  2279. - `help_post` text collate utf8_unicode_ci COMMENT 'Description and/or help text to display after fields in form.',
  2280. - `javascript` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional',
  2281. + `help_pre` text COMMENT 'Description and/or help text to display before fields in form.',
  2282. + `help_post` text COMMENT 'Description and/or help text to display after fields in form.',
  2283. + `javascript` varchar(64) default NULL COMMENT 'Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional',
  2284. PRIMARY KEY (`id`),
  2285. UNIQUE KEY `UI_name` (`name`),
  2286. UNIQUE KEY `UI_title` (`title`),
  2287. KEY `FK_civicrm_price_set_domain_id` (`domain_id`)
  2288. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  2289. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  2290.  
  2291. -- --------------------------------------------------------
  2292.  
  2293. @@ -1960,13 +1869,13 @@
  2294.  
  2295. CREATE TABLE `civicrm_price_set_entity` (
  2296. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Price Set Entity',
  2297. - `entity_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Table which uses this price set',
  2298. + `entity_table` varchar(64) NOT NULL COMMENT 'Table which uses this price set',
  2299. `entity_id` int(10) unsigned NOT NULL COMMENT 'Item in table',
  2300. `price_set_id` int(10) unsigned NOT NULL COMMENT 'price set being used',
  2301. PRIMARY KEY (`id`),
  2302. UNIQUE KEY `UI_entity` (`entity_table`,`entity_id`),
  2303. KEY `FK_civicrm_price_set_entity_price_set_id` (`price_set_id`)
  2304. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  2305. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  2306.  
  2307. -- --------------------------------------------------------
  2308.  
  2309. @@ -1977,25 +1886,25 @@
  2310. CREATE TABLE `civicrm_product` (
  2311. `id` int(10) unsigned NOT NULL auto_increment,
  2312. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this product class.',
  2313. - `name` varchar(255) collate utf8_unicode_ci NOT NULL COMMENT 'Required product/premium name',
  2314. - `description` text collate utf8_unicode_ci COMMENT 'Optional description of the product/premium.',
  2315. - `sku` varchar(50) collate utf8_unicode_ci default NULL COMMENT 'Optional product sku or code.',
  2316. - `options` text collate utf8_unicode_ci COMMENT 'Store comma-delimited list of color, size, etc. options for the product.',
  2317. - `image` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Full or relative URL to uploaded image - fullsize.',
  2318. - `thumbnail` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Full or relative URL to image thumbnail.',
  2319. + `name` varchar(255) NOT NULL COMMENT 'Required product/premium name',
  2320. + `description` text COMMENT 'Optional description of the product/premium.',
  2321. + `sku` varchar(50) default NULL COMMENT 'Optional product sku or code.',
  2322. + `options` text COMMENT 'Store comma-delimited list of color, size, etc. options for the product.',
  2323. + `image` varchar(255) default NULL COMMENT 'Full or relative URL to uploaded image - fullsize.',
  2324. + `thumbnail` varchar(255) default NULL COMMENT 'Full or relative URL to image thumbnail.',
  2325. `price` decimal(20,2) default NULL COMMENT 'Sell price or market value for premiums. For tax-deductible contributions, this will be stored as non_deductible_amount in the contribution record.',
  2326. `min_contribution` decimal(20,2) default NULL COMMENT 'Minimum contribution required to be eligible to select this premium.',
  2327. `cost` decimal(20,2) default NULL COMMENT 'Actual cost of this product. Useful to determine net return from sale or using this as an incentive.',
  2328. `is_active` tinyint(4) NOT NULL COMMENT 'Disabling premium removes it from the premiums_premium join table below.',
  2329. - `period_type` enum('rolling','fixed') collate utf8_unicode_ci default 'rolling' COMMENT 'Rolling means we set start/end based on current day, fixed means we set start/end for current year or month\n(e.g. 1 year + fixed -> we would set start/end for 1/1/06 thru 12/31/06 for any premium chosen in 2006) ',
  2330. + `period_type` enum('rolling','fixed') default 'rolling' COMMENT 'Rolling means we set start/end based on current day, fixed means we set start/end for current year or month\n(e.g. 1 year + fixed -> we would set start/end for 1/1/06 thru 12/31/06 for any premium chosen in 2006) ',
  2331. `fixed_period_start_day` int(11) default '101' COMMENT 'Month and day (MMDD) that fixed period type subscription or membership starts.',
  2332. - `duration_unit` enum('day','month','week','year') collate utf8_unicode_ci default 'year',
  2333. + `duration_unit` enum('day','month','week','year') default 'year',
  2334. `duration_interval` int(11) default NULL COMMENT 'Number of units for total duration of subscription, service, membership (e.g. 12 Months).',
  2335. - `frequency_unit` enum('day','month','week','year') collate utf8_unicode_ci default 'month' COMMENT 'Frequency unit and interval allow option to store actual delivery frequency for a subscription or service.',
  2336. + `frequency_unit` enum('day','month','week','year') default 'month' COMMENT 'Frequency unit and interval allow option to store actual delivery frequency for a subscription or service.',
  2337. `frequency_interval` int(11) default NULL COMMENT 'Number of units for delivery frequency of subscription, service, membership (e.g. every 3 Months).',
  2338. PRIMARY KEY (`id`),
  2339. KEY `FK_civicrm_product_domain_id` (`domain_id`)
  2340. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
  2341. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  2342.  
  2343. -- --------------------------------------------------------
  2344.  
  2345. @@ -2006,10 +1915,10 @@
  2346. CREATE TABLE `civicrm_project` (
  2347. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Project ID',
  2348. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this record.',
  2349. - `title` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Project name.',
  2350. - `description` text collate utf8_unicode_ci COMMENT 'Optional verbose description of the project. May be used for display - HTML allowed.',
  2351. - `logo` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Full or relative URL to optional uploaded logo image for project.',
  2352. - `owner_entity_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Name of table where project owner being referenced is stored (e.g. civicrm_contact or civicrm_group).',
  2353. + `title` varchar(64) default NULL COMMENT 'Project name.',
  2354. + `description` text COMMENT 'Optional verbose description of the project. May be used for display - HTML allowed.',
  2355. + `logo` varchar(255) default NULL COMMENT 'Full or relative URL to optional uploaded logo image for project.',
  2356. + `owner_entity_table` varchar(64) NOT NULL COMMENT 'Name of table where project owner being referenced is stored (e.g. civicrm_contact or civicrm_group).',
  2357. `owner_entity_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to project owner (contact, group, etc.).',
  2358. `start_date` datetime default NULL COMMENT 'Project start date.',
  2359. `end_date` datetime default NULL COMMENT 'Project end date.',
  2360. @@ -2018,7 +1927,7 @@
  2361. PRIMARY KEY (`id`),
  2362. UNIQUE KEY `UI_project_owner` (`id`,`owner_entity_table`,`owner_entity_id`),
  2363. KEY `FK_civicrm_project_domain_id` (`domain_id`)
  2364. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  2365. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  2366.  
  2367. -- --------------------------------------------------------
  2368.  
  2369. @@ -2034,12 +1943,12 @@
  2370. `start_date` date default NULL COMMENT 'date when the relationship started',
  2371. `end_date` date default NULL COMMENT 'date when the relationship ended',
  2372. `is_active` tinyint(4) default '1' COMMENT 'is the relationship active ?',
  2373. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Optional verbose description for the relationship.',
  2374. + `description` varchar(255) default NULL COMMENT 'Optional verbose description for the relationship.',
  2375. PRIMARY KEY (`id`),
  2376. KEY `FK_civicrm_relationship_contact_id_a` (`contact_id_a`),
  2377. KEY `FK_civicrm_relationship_contact_id_b` (`contact_id_b`),
  2378. KEY `FK_civicrm_relationship_relationship_type_id` (`relationship_type_id`)
  2379. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=151 ;
  2380. +) TYPE=InnoDB AUTO_INCREMENT=64 ;
  2381.  
  2382. -- --------------------------------------------------------
  2383.  
  2384. @@ -2050,18 +1959,18 @@
  2385. CREATE TABLE `civicrm_relationship_type` (
  2386. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Primary key',
  2387. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this contact',
  2388. - `name_a_b` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'name/label for relationship of contact_a to contact_b.',
  2389. - `name_b_a` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Optional name/label for relationship of contact_b to contact_a.',
  2390. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Optional verbose description of the relationship type.',
  2391. - `contact_type_a` enum('Individual','Organization','Household') collate utf8_unicode_ci default NULL COMMENT 'If defined, contact_a in a relationship of this type must be a specific contact_type.',
  2392. - `contact_type_b` enum('Individual','Organization','Household') collate utf8_unicode_ci default NULL COMMENT 'If defined, contact_b in a relationship of this type must be a specific contact_type.',
  2393. + `name_a_b` varchar(64) default NULL COMMENT 'name/label for relationship of contact_a to contact_b.',
  2394. + `name_b_a` varchar(64) default NULL COMMENT 'Optional name/label for relationship of contact_b to contact_a.',
  2395. + `description` varchar(255) default NULL COMMENT 'Optional verbose description of the relationship type.',
  2396. + `contact_type_a` enum('Individual','Organization','Household') default NULL COMMENT 'If defined, contact_a in a relationship of this type must be a specific contact_type.',
  2397. + `contact_type_b` enum('Individual','Organization','Household') default NULL COMMENT 'If defined, contact_b in a relationship of this type must be a specific contact_type.',
  2398. `is_reserved` tinyint(4) default NULL COMMENT 'Is this relationship type a predefined system type (can not be changed or de-activated)?',
  2399. `is_active` tinyint(4) default '1' COMMENT 'Is this relationship type currently active (i.e. can be used when creating or editing relationships)?',
  2400. PRIMARY KEY (`id`),
  2401. UNIQUE KEY `UI_name_a_b_domain_id` (`name_a_b`,`domain_id`),
  2402. UNIQUE KEY `UI_name_b_a_domain_id` (`name_b_a`,`domain_id`),
  2403. KEY `FK_civicrm_relationship_type_domain_id` (`domain_id`)
  2404. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ;
  2405. +) TYPE=InnoDB AUTO_INCREMENT=8 ;
  2406.  
  2407. -- --------------------------------------------------------
  2408.  
  2409. @@ -2071,15 +1980,29 @@
  2410.  
  2411. CREATE TABLE `civicrm_saved_search` (
  2412. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Saved search ID',
  2413. - `form_values` text collate utf8_unicode_ci COMMENT 'Submitted form values for this search',
  2414. + `form_values` text COMMENT 'Submitted form values for this search',
  2415. `mapping_id` int(10) unsigned default NULL COMMENT 'Foreign key to civicrm_mapping used for saved search-builder searches.',
  2416. - `search_custom_id` int(10) unsigned default NULL COMMENT 'Foreign key to civicrm_option value table used for saved custom searches.',
  2417. - `where_clause` text collate utf8_unicode_ci COMMENT 'the sql where clause if a saved search acl',
  2418. - `select_tables` text collate utf8_unicode_ci COMMENT 'the tables to be included in a select data',
  2419. - `where_tables` text collate utf8_unicode_ci COMMENT 'the tables to be included in the count statement',
  2420. + `where_clause` text COMMENT 'the sql where clause if a saved search acl',
  2421. + `select_tables` text COMMENT 'the tables to be included in a select data',
  2422. + `where_tables` text COMMENT 'the tables to be included in the count statement',
  2423. PRIMARY KEY (`id`),
  2424. KEY `FK_civicrm_saved_search_mapping_id` (`mapping_id`)
  2425. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  2426. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  2427. +
  2428. +-- --------------------------------------------------------
  2429. +
  2430. +--
  2431. +-- Table structure for table `civicrm_sms_history`
  2432. +--
  2433. +
  2434. +CREATE TABLE `civicrm_sms_history` (
  2435. + `id` int(10) unsigned NOT NULL auto_increment COMMENT 'SMS History ID',
  2436. + `message` text COMMENT 'Contents of the SMS.',
  2437. + `contact_id` int(10) unsigned NOT NULL COMMENT 'FK to Contact who is sending this SMS',
  2438. + `sent_date` date default NULL COMMENT 'When was this SMS sent',
  2439. + PRIMARY KEY (`id`),
  2440. + KEY `FK_civicrm_sms_history_contact_id` (`contact_id`)
  2441. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  2442.  
  2443. -- --------------------------------------------------------
  2444.  
  2445. @@ -2089,13 +2012,13 @@
  2446.  
  2447. CREATE TABLE `civicrm_state_province` (
  2448. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'State / Province ID',
  2449. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Name of State / Province',
  2450. - `abbreviation` varchar(4) collate utf8_unicode_ci default NULL COMMENT '2-4 Character Abbreviation of State / Province',
  2451. + `name` varchar(64) default NULL COMMENT 'Name of State / Province',
  2452. + `abbreviation` varchar(4) default NULL COMMENT '2-4 Character Abbreviation of State / Province',
  2453. `country_id` int(10) unsigned NOT NULL COMMENT 'ID of Country that State / Province belong',
  2454. PRIMARY KEY (`id`),
  2455. UNIQUE KEY `UI_name_country_id` (`name`,`country_id`),
  2456. KEY `FK_civicrm_state_province_country_id` (`country_id`)
  2457. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=10000 ;
  2458. +) TYPE=InnoDB AUTO_INCREMENT=10000 ;
  2459.  
  2460. -- --------------------------------------------------------
  2461.  
  2462. @@ -2108,13 +2031,13 @@
  2463. `contact_id` int(10) unsigned NOT NULL COMMENT 'Contact Id',
  2464. `group_id` int(10) unsigned default NULL COMMENT 'Group Id',
  2465. `date` datetime NOT NULL COMMENT 'Date of the (un)subscription',
  2466. - `method` enum('Admin','Email','Web','API') collate utf8_unicode_ci default NULL COMMENT 'How the (un)subscription was triggered',
  2467. - `status` enum('Added','Removed','Pending') collate utf8_unicode_ci default NULL COMMENT 'The state of the contact within the group',
  2468. - `tracking` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'IP address or other tracking info',
  2469. + `method` enum('Admin','Email','Web','API') default NULL COMMENT 'How the (un)subscription was triggered',
  2470. + `status` enum('Added','Removed','Pending') default NULL COMMENT 'The state of the contact within the group',
  2471. + `tracking` varchar(255) default NULL COMMENT 'IP address or other tracking info',
  2472. PRIMARY KEY (`id`),
  2473. KEY `FK_civicrm_subscription_history_contact_id` (`contact_id`),
  2474. KEY `FK_civicrm_subscription_history_group_id` (`group_id`)
  2475. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=84 ;
  2476. +) TYPE=InnoDB AUTO_INCREMENT=493 ;
  2477.  
  2478. -- --------------------------------------------------------
  2479.  
  2480. @@ -2125,14 +2048,14 @@
  2481. CREATE TABLE `civicrm_tag` (
  2482. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Tag ID',
  2483. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this tag',
  2484. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Name of Tag.',
  2485. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Optional verbose description of the tag.',
  2486. + `name` varchar(64) default NULL COMMENT 'Name of Tag.',
  2487. + `description` varchar(255) default NULL COMMENT 'Optional verbose description of the tag.',
  2488. `parent_id` int(10) unsigned default NULL COMMENT 'Optional parent id for this tag.',
  2489. PRIMARY KEY (`id`),
  2490. UNIQUE KEY `UI_name_domain_id` (`name`,`domain_id`),
  2491. KEY `FK_civicrm_tag_domain_id` (`domain_id`),
  2492. KEY `FK_civicrm_tag_parent_id` (`parent_id`)
  2493. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ;
  2494. +) TYPE=InnoDB AUTO_INCREMENT=6 ;
  2495.  
  2496. -- --------------------------------------------------------
  2497.  
  2498. @@ -2143,22 +2066,22 @@
  2499. CREATE TABLE `civicrm_task` (
  2500. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Task ID',
  2501. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this record.',
  2502. - `title` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Task name.',
  2503. - `description` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Optional verbose description of the Task. May be used for display - HTML allowed.',
  2504. + `title` varchar(64) default NULL COMMENT 'Task name.',
  2505. + `description` varchar(255) default NULL COMMENT 'Optional verbose description of the Task. May be used for display - HTML allowed.',
  2506. `task_type_id` int(10) unsigned default NULL COMMENT 'Configurable task type values (e.g. App Submit, App Review...). FK to civicrm_option_value.',
  2507. - `owner_entity_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Name of table where Task owner being referenced is stored (e.g. civicrm_contact or civicrm_group).',
  2508. + `owner_entity_table` varchar(64) NOT NULL COMMENT 'Name of table where Task owner being referenced is stored (e.g. civicrm_contact or civicrm_group).',
  2509. `owner_entity_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to Task owner (contact, group, etc.).',
  2510. - `parent_entity_table` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Name of table where optional Task parent is stored (e.g. civicrm_project, or civicrm_task for sub-tasks).',
  2511. + `parent_entity_table` varchar(64) default NULL COMMENT 'Name of table where optional Task parent is stored (e.g. civicrm_project, or civicrm_task for sub-tasks).',
  2512. `parent_entity_id` int(10) unsigned default NULL COMMENT 'Optional foreign key to Task Parent (project, another task, etc.).',
  2513. `due_date` datetime default NULL COMMENT 'Task due date.',
  2514. `priority_id` int(10) unsigned default NULL COMMENT 'Configurable priority value (e.g. Critical, High, Medium...). FK to civicrm_option_value.',
  2515. - `task_class` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Optional key to a process class related to this task (e.g. CRM_Quest_PreApp).',
  2516. + `task_class` varchar(255) default NULL COMMENT 'Optional key to a process class related to this task (e.g. CRM_Quest_PreApp).',
  2517. `is_active` tinyint(4) default NULL COMMENT 'Is this record active? For tasks: can it be assigned, does it appear on open task listings, etc.',
  2518. PRIMARY KEY (`id`),
  2519. UNIQUE KEY `UI_task_owner` (`id`,`owner_entity_table`,`owner_entity_id`),
  2520. UNIQUE KEY `UI_task_parent` (`id`,`parent_entity_table`,`parent_entity_id`),
  2521. KEY `FK_civicrm_task_domain_id` (`domain_id`)
  2522. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  2523. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  2524.  
  2525. -- --------------------------------------------------------
  2526.  
  2527. @@ -2169,55 +2092,18 @@
  2528. CREATE TABLE `civicrm_task_status` (
  2529. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Task ID',
  2530. `task_id` int(10) unsigned NOT NULL COMMENT 'Status is for which task.',
  2531. - `responsible_entity_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Entity responsible for this task_status instance (table where entity is stored e.g. civicrm_contact or civicrm_group).',
  2532. + `responsible_entity_table` varchar(64) NOT NULL COMMENT 'Entity responsible for this task_status instance (table where entity is stored e.g. civicrm_contact or civicrm_group).',
  2533. `responsible_entity_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to responsible entity (contact, group, etc.).',
  2534. - `target_entity_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Optional target entity for this task_status instance, i.e. review this membership application-prospect member contact record is target (table where entity is stored e.g. civicrm_contact or civicrm_group).',
  2535. + `target_entity_table` varchar(64) NOT NULL COMMENT 'Optional target entity for this task_status instance, i.e. review this membership application-prospect member contact record is target (table where entity is stored e.g. civicrm_contact or civicrm_group).',
  2536. `target_entity_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to target entity (contact, group, etc.).',
  2537. - `status_detail` text collate utf8_unicode_ci COMMENT 'Encoded array of status details used for programmatic progress reporting and tracking.',
  2538. + `status_detail` text COMMENT 'Encoded array of status details used for programmatic progress reporting and tracking.',
  2539. `status_id` int(10) unsigned default NULL COMMENT 'Configurable status value (e.g. Not Started, In Progress, Completed, Deferred...). FK to civicrm_option_value.',
  2540. `create_date` datetime default NULL COMMENT 'Date this record was created (date work on task started).',
  2541. `modified_date` datetime default NULL COMMENT 'Date-time of last update to this task_status record.',
  2542. PRIMARY KEY (`id`),
  2543. KEY `index_task_status_responsible` (`task_id`,`responsible_entity_table`,`responsible_entity_id`),
  2544. KEY `index_task_status_target` (`task_id`,`target_entity_table`,`target_entity_id`)
  2545. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  2546. -
  2547. --- --------------------------------------------------------
  2548. -
  2549. ---
  2550. --- Table structure for table `civicrm_tell_friend`
  2551. ---
  2552. -
  2553. -CREATE TABLE `civicrm_tell_friend` (
  2554. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Friend ID',
  2555. - `entity_table` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Name of table where item being referenced is stored.',
  2556. - `entity_id` int(10) unsigned NOT NULL COMMENT 'Foreign key to the referenced item.',
  2557. - `title` varchar(255) collate utf8_unicode_ci default NULL,
  2558. - `intro` text collate utf8_unicode_ci COMMENT 'Introductory message to contributor or participant displayed on the Tell a Friend form.',
  2559. - `suggested_message` text collate utf8_unicode_ci COMMENT 'Suggested message to friends, provided as default on the Tell A Friend form.',
  2560. - `general_link` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'URL for general info about the organization - included in the email sent to friends.',
  2561. - `thankyou_title` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Text for Tell a Friend thank you page header and HTML title.',
  2562. - `thankyou_text` text collate utf8_unicode_ci COMMENT 'Thank you message displayed on success page.',
  2563. - `is_active` tinyint(4) default NULL,
  2564. - PRIMARY KEY (`id`)
  2565. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  2566. -
  2567. --- --------------------------------------------------------
  2568. -
  2569. ---
  2570. --- Table structure for table `civicrm_timezone`
  2571. ---
  2572. -
  2573. -CREATE TABLE `civicrm_timezone` (
  2574. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Timezone Id',
  2575. - `name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Timezone full name',
  2576. - `abbreviation` char(3) collate utf8_unicode_ci default NULL COMMENT 'ISO Code for timezone abbreviation',
  2577. - `gmt` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'GMT name of the timezone',
  2578. - `offset` int(11) default NULL,
  2579. - `country_id` int(10) unsigned NOT NULL COMMENT 'Country Id',
  2580. - PRIMARY KEY (`id`),
  2581. - KEY `FK_civicrm_timezone_country_id` (`country_id`)
  2582. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  2583. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  2584.  
  2585. -- --------------------------------------------------------
  2586.  
  2587. @@ -2228,23 +2114,23 @@
  2588. CREATE TABLE `civicrm_uf_field` (
  2589. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique table ID',
  2590. `uf_group_id` int(10) unsigned NOT NULL COMMENT 'Which form does this field belong to.',
  2591. - `field_name` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Name for CiviCRM field which is being exposed for sharing.',
  2592. + `field_name` varchar(64) default NULL COMMENT 'Name for CiviCRM field which is being exposed for sharing.',
  2593. `is_active` tinyint(4) default '1' COMMENT 'Is this field currently shareable? If false, hide the field for all sharing contexts.',
  2594. `is_view` tinyint(4) default '0' COMMENT 'the field is view only and not editable in user forms.',
  2595. `is_required` tinyint(4) default '0' COMMENT 'Is this field required when included in a user or registration form?',
  2596. `weight` int(11) NOT NULL default '1' COMMENT 'Controls field display order when user framework fields are displayed in registration and account editing forms.',
  2597. - `help_post` text collate utf8_unicode_ci COMMENT 'Description and/or help text to display after this field.',
  2598. - `visibility` enum('User and User Admin Only','Public User Pages','Public User Pages and Listings') collate utf8_unicode_ci default 'User and User Admin Only' COMMENT 'In what context(s) is this field visible.',
  2599. + `help_post` text COMMENT 'Description and/or help text to display after this field.',
  2600. + `visibility` enum('User and User Admin Only','Public User Pages','Public User Pages and Listings') default 'User and User Admin Only' COMMENT 'In what context(s) is this field visible.',
  2601. `in_selector` tinyint(4) default '0' COMMENT 'Is this field included as a column in the selector table?',
  2602. `is_searchable` tinyint(4) default '0' COMMENT 'Is this field included search form of profile?',
  2603. `location_type_id` int(10) unsigned default NULL COMMENT 'Location type of this mapping, if required',
  2604. - `phone_type` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Phone type, if required',
  2605. - `label` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'To save label for fields.',
  2606. - `field_type` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'This field saves field type (ie individual,household.. field etc).',
  2607. + `phone_type` varchar(64) default NULL COMMENT 'Phone type, if required',
  2608. + `label` varchar(255) default NULL COMMENT 'To save label for fields.',
  2609. + `field_type` varchar(255) default NULL COMMENT 'This field saves field type (ie individual,household.. field etc).',
  2610. PRIMARY KEY (`id`),
  2611. KEY `FK_civicrm_uf_field_uf_group_id` (`uf_group_id`),
  2612. KEY `FK_civicrm_uf_field_location_type_id` (`location_type_id`)
  2613. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=8 ;
  2614. +) TYPE=InnoDB AUTO_INCREMENT=20 ;
  2615.  
  2616. -- --------------------------------------------------------
  2617.  
  2618. @@ -2256,27 +2142,27 @@
  2619. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique table ID',
  2620. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this form.',
  2621. `is_active` tinyint(4) default '1' COMMENT 'Is this form currently active? If false, hide all related fields for all sharing contexts.',
  2622. - `form_type` enum('CiviCRM Profile') collate utf8_unicode_ci default NULL COMMENT 'Type of form.',
  2623. - `title` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Form title.',
  2624. + `form_type` enum('CiviCRM Profile') default NULL COMMENT 'Type of form.',
  2625. + `title` varchar(64) default NULL COMMENT 'Form title.',
  2626. `collapse_display` int(10) unsigned default '0' COMMENT 'Will this group be in collapsed or expanded mode on initial display ?',
  2627. - `help_pre` text collate utf8_unicode_ci COMMENT 'Description and/or help text to display before fields in form.',
  2628. - `help_post` text collate utf8_unicode_ci COMMENT 'Description and/or help text to display after fields in form.',
  2629. + `help_pre` text COMMENT 'Description and/or help text to display before fields in form.',
  2630. + `help_post` text COMMENT 'Description and/or help text to display after fields in form.',
  2631. `limit_listings_group_id` int(10) unsigned default NULL COMMENT 'Group id, foriegn key from civicrm_group',
  2632. - `post_URL` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Redirect to URL.',
  2633. + `post_URL` varchar(255) default NULL COMMENT 'Redirect to URL.',
  2634. `add_to_group_id` int(10) unsigned default NULL COMMENT 'foreign key to civicrm_group_id',
  2635. `add_captcha` tinyint(4) default '0' COMMENT 'Should a CAPTCHA widget be included this Profile form.',
  2636. `is_map` tinyint(4) default '0' COMMENT 'Do we want to map results from this profile.',
  2637. `is_edit_link` tinyint(4) default '0' COMMENT 'Should edit link display in profile selector',
  2638. `is_uf_link` tinyint(4) default '0' COMMENT 'Should we display a link to the website profile in profile selector',
  2639. `is_update_dupe` tinyint(4) default '0' COMMENT 'Should we update the contact record if we find a duplicate',
  2640. - `cancel_URL` varchar(255) collate utf8_unicode_ci default NULL COMMENT 'Redirect to URL when Cancle button clik .',
  2641. + `cancel_URL` varchar(255) default NULL COMMENT 'Redirect to URL when Cancle button clik .',
  2642. `is_cms_user` tinyint(4) default '0' COMMENT 'Should we create a cms user for this profile ',
  2643. - `notify` varchar(255) collate utf8_unicode_ci default NULL,
  2644. + `notify` varchar(255) default NULL,
  2645. PRIMARY KEY (`id`),
  2646. KEY `FK_civicrm_uf_group_domain_id` (`domain_id`),
  2647. KEY `FK_civicrm_uf_group_limit_listings_group_id` (`limit_listings_group_id`),
  2648. KEY `FK_civicrm_uf_group_add_to_group_id` (`add_to_group_id`)
  2649. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
  2650. +) TYPE=InnoDB AUTO_INCREMENT=5 ;
  2651.  
  2652. -- --------------------------------------------------------
  2653.  
  2654. @@ -2287,15 +2173,15 @@
  2655. CREATE TABLE `civicrm_uf_join` (
  2656. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique table ID',
  2657. `is_active` tinyint(4) default '1' COMMENT 'Is this join currently active?',
  2658. - `module` varchar(64) collate utf8_unicode_ci NOT NULL COMMENT 'Module which owns this uf_join instance, e.g. User Registration, CiviDonate, etc.',
  2659. - `entity_table` varchar(64) collate utf8_unicode_ci default NULL COMMENT 'Name of table where item being referenced is stored. Modules which only need a single collection of uf_join instances may choose not to populate entity_table and entity_id.',
  2660. + `module` varchar(64) NOT NULL COMMENT 'Module which owns this uf_join instance, e.g. User Registration, CiviDonate, etc.',
  2661. + `entity_table` varchar(64) default NULL COMMENT 'Name of table where item being referenced is stored. Modules which only need a single collection of uf_join instances may choose not to populate entity_table and entity_id.',
  2662. `entity_id` int(10) unsigned default NULL COMMENT 'Foreign key to the referenced item.',
  2663. `weight` int(11) NOT NULL default '1' COMMENT 'Controls display order when multiple user framework groups are setup for concurrent display.',
  2664. `uf_group_id` int(10) unsigned NOT NULL COMMENT 'Which form does this field belong to.',
  2665. PRIMARY KEY (`id`),
  2666. KEY `index_entity` (`entity_table`,`entity_id`),
  2667. KEY `FK_civicrm_uf_join_uf_group_id` (`uf_group_id`)
  2668. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;
  2669. +) TYPE=InnoDB AUTO_INCREMENT=23 ;
  2670.  
  2671. -- --------------------------------------------------------
  2672.  
  2673. @@ -2306,45 +2192,31 @@
  2674. CREATE TABLE `civicrm_uf_match` (
  2675. `id` int(10) unsigned NOT NULL auto_increment COMMENT 'System generated ID.',
  2676. `uf_id` int(10) unsigned NOT NULL COMMENT 'UF ID',
  2677. - `uf_name` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'UF Name',
  2678. - `contact_id` int(10) unsigned default NULL COMMENT 'FK to Contact ID',
  2679. + `contact_id` int(10) unsigned NOT NULL COMMENT 'FK to Contact ID',
  2680. `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this contact (cached here for ease of use reasons)',
  2681. + `email` varchar(64) default NULL COMMENT 'Email address',
  2682. PRIMARY KEY (`id`),
  2683. UNIQUE KEY `UI_uf_domain_id` (`uf_id`,`domain_id`),
  2684. - UNIQUE KEY `UI_uf_name_domain_id` (`uf_name`,`domain_id`),
  2685. UNIQUE KEY `UI_contact` (`contact_id`),
  2686. KEY `FK_civicrm_uf_match_domain_id` (`domain_id`)
  2687. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ;
  2688. +) TYPE=InnoDB AUTO_INCREMENT=34 ;
  2689.  
  2690. -- --------------------------------------------------------
  2691.  
  2692. --
  2693. --- Table structure for table `civicrm_value_1_constituent_information`
  2694. +-- Table structure for table `civicrm_validation`
  2695. --
  2696.  
  2697. -CREATE TABLE `civicrm_value_1_constituent_information` (
  2698. - `id` int(10) NOT NULL auto_increment,
  2699. - `domain_id` int(10) NOT NULL,
  2700. - `entity_id` int(10) NOT NULL,
  2701. - `most_important_issue` varchar(255) collate utf8_unicode_ci default NULL,
  2702. - `marital_status` varchar(255) collate utf8_unicode_ci default NULL,
  2703. +CREATE TABLE `civicrm_validation` (
  2704. + `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Unique Validation ID',
  2705. + `domain_id` int(10) unsigned NOT NULL COMMENT 'Which Domain owns this contact',
  2706. + `type` enum('Email','Money','URL','Phone','Positive Integer','Variable Name','Range','Regular Expression Match','Regular Expression No Match') default NULL COMMENT 'List of rule built-in rule types. custom types may be added to ENUM via directory scan.',
  2707. + `parameters` varchar(255) default NULL COMMENT 'optional value(s) passed to validation function, e.g. a regular expression, min and max for Range, operator + number for Comparison type, etc.',
  2708. + `function_name` varchar(128) default NULL COMMENT 'custom validation function name. Class methods should be invoked using php syntax array(CLASS_NAME, FN_NAME)',
  2709. + `description` varchar(255) default NULL COMMENT 'Rule Description.',
  2710. PRIMARY KEY (`id`),
  2711. - UNIQUE KEY `unique_domain_id_entity_id` (`domain_id`,`entity_id`),
  2712. - KEY `index_marital_status` (`marital_status`),
  2713. - KEY `index_most_important_issue` (`most_important_issue`)
  2714. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
  2715. -
  2716. --- --------------------------------------------------------
  2717. -
  2718. ---
  2719. --- Table structure for table `civicrm_worldregion`
  2720. ---
  2721. -
  2722. -CREATE TABLE `civicrm_worldregion` (
  2723. - `id` int(10) unsigned NOT NULL auto_increment COMMENT 'Country Id',
  2724. - `name` varchar(128) collate utf8_unicode_ci default NULL COMMENT 'Region name to be associated with countries',
  2725. - PRIMARY KEY (`id`)
  2726. -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=100 ;
  2727. + KEY `FK_civicrm_validation_domain_id` (`domain_id`)
  2728. +) TYPE=InnoDB AUTO_INCREMENT=1 ;
  2729.  
  2730. --
  2731. -- Constraints for dumped tables
  2732. @@ -2360,8 +2232,8 @@
  2733. -- Constraints for table `civicrm_acl_cache`
  2734. --
  2735. ALTER TABLE `civicrm_acl_cache`
  2736. - ADD CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`),
  2737. - ADD CONSTRAINT `FK_civicrm_acl_cache_acl_id` FOREIGN KEY (`acl_id`) REFERENCES `civicrm_acl` (`id`);
  2738. + ADD CONSTRAINT `FK_civicrm_acl_cache_acl_id` FOREIGN KEY (`acl_id`) REFERENCES `civicrm_acl` (`id`),
  2739. + ADD CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`);
  2740.  
  2741. --
  2742. -- Constraints for table `civicrm_acl_entity_role`
  2743. @@ -2373,85 +2245,64 @@
  2744. -- Constraints for table `civicrm_activity`
  2745. --
  2746. ALTER TABLE `civicrm_activity`
  2747. - ADD CONSTRAINT `FK_civicrm_activity_source_contact_id` FOREIGN KEY (`source_contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
  2748. - ADD CONSTRAINT `FK_civicrm_activity_phone_id` FOREIGN KEY (`phone_id`) REFERENCES `civicrm_phone` (`id`) ON DELETE SET NULL,
  2749. - ADD CONSTRAINT `FK_civicrm_activity_parent_id` FOREIGN KEY (`parent_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE CASCADE;
  2750. + ADD CONSTRAINT `FK_civicrm_activity_parent_id` FOREIGN KEY (`parent_id`) REFERENCES `civicrm_activity` (`id`),
  2751. + ADD CONSTRAINT `FK_civicrm_activity_source_contact_id` FOREIGN KEY (`source_contact_id`) REFERENCES `civicrm_contact` (`id`);
  2752.  
  2753. --
  2754. --- Constraints for table `civicrm_activity_assignment`
  2755. +-- Constraints for table `civicrm_activity_history`
  2756. --
  2757. -ALTER TABLE `civicrm_activity_assignment`
  2758. - ADD CONSTRAINT `FK_civicrm_activity_assignment_activity_id` FOREIGN KEY (`activity_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE CASCADE,
  2759. - ADD CONSTRAINT `FK_civicrm_activity_assignment_assignee_contact_id` FOREIGN KEY (`assignee_contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE;
  2760. -
  2761. ---
  2762. --- Constraints for table `civicrm_activity_target`
  2763. ---
  2764. -ALTER TABLE `civicrm_activity_target`
  2765. - ADD CONSTRAINT `FK_civicrm_activity_target_activity_id` FOREIGN KEY (`activity_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE CASCADE,
  2766. - ADD CONSTRAINT `FK_civicrm_activity_target_target_contact_id` FOREIGN KEY (`target_contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE;
  2767. +ALTER TABLE `civicrm_activity_history`
  2768. + ADD CONSTRAINT `FK_civicrm_activity_history_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`),
  2769. + ADD CONSTRAINT `FK_civicrm_activity_history_relationship_id` FOREIGN KEY (`relationship_id`) REFERENCES `civicrm_relationship` (`id`);
  2770.  
  2771. --
  2772. -- Constraints for table `civicrm_address`
  2773. --
  2774. ALTER TABLE `civicrm_address`
  2775. - ADD CONSTRAINT `FK_civicrm_address_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
  2776. - ADD CONSTRAINT `FK_civicrm_address_county_id` FOREIGN KEY (`county_id`) REFERENCES `civicrm_county` (`id`) ON DELETE SET NULL,
  2777. - ADD CONSTRAINT `FK_civicrm_address_state_province_id` FOREIGN KEY (`state_province_id`) REFERENCES `civicrm_state_province` (`id`) ON DELETE SET NULL,
  2778. - ADD CONSTRAINT `FK_civicrm_address_country_id` FOREIGN KEY (`country_id`) REFERENCES `civicrm_country` (`id`) ON DELETE SET NULL;
  2779. -
  2780. ---
  2781. --- Constraints for table `civicrm_case`
  2782. ---
  2783. -ALTER TABLE `civicrm_case`
  2784. - ADD CONSTRAINT `FK_civicrm_case_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE;
  2785. -
  2786. ---
  2787. --- Constraints for table `civicrm_case_activity`
  2788. ---
  2789. -ALTER TABLE `civicrm_case_activity`
  2790. - ADD CONSTRAINT `FK_civicrm_case_activity_case_id` FOREIGN KEY (`case_id`) REFERENCES `civicrm_case` (`id`) ON DELETE CASCADE,
  2791. - ADD CONSTRAINT `FK_civicrm_case_activity_activity_id` FOREIGN KEY (`activity_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE CASCADE;
  2792. + ADD CONSTRAINT `FK_civicrm_address_country_id` FOREIGN KEY (`country_id`) REFERENCES `civicrm_country` (`id`),
  2793. + ADD CONSTRAINT `FK_civicrm_address_county_id` FOREIGN KEY (`county_id`) REFERENCES `civicrm_county` (`id`),
  2794. + ADD CONSTRAINT `FK_civicrm_address_geo_coord_id` FOREIGN KEY (`geo_coord_id`) REFERENCES `civicrm_geo_coord` (`id`),
  2795. + ADD CONSTRAINT `FK_civicrm_address_location_id` FOREIGN KEY (`location_id`) REFERENCES `civicrm_location` (`id`),
  2796. + ADD CONSTRAINT `FK_civicrm_address_state_province_id` FOREIGN KEY (`state_province_id`) REFERENCES `civicrm_state_province` (`id`);
  2797.  
  2798. --
  2799. -- Constraints for table `civicrm_contact`
  2800. --
  2801. ALTER TABLE `civicrm_contact`
  2802. - ADD CONSTRAINT `FK_civicrm_contact_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`),
  2803. - ADD CONSTRAINT `FK_civicrm_contact_primary_contact_id` FOREIGN KEY (`primary_contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL;
  2804. + ADD CONSTRAINT `FK_civicrm_contact_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`);
  2805.  
  2806. --
  2807. -- Constraints for table `civicrm_contribution`
  2808. --
  2809. ALTER TABLE `civicrm_contribution`
  2810. + ADD CONSTRAINT `FK_civicrm_contribution_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`),
  2811. + ADD CONSTRAINT `FK_civicrm_contribution_contribution_page_id` FOREIGN KEY (`contribution_page_id`) REFERENCES `civicrm_contribution_page` (`id`),
  2812. + ADD CONSTRAINT `FK_civicrm_contribution_contribution_recur_id` FOREIGN KEY (`contribution_recur_id`) REFERENCES `civicrm_contribution_recur` (`id`),
  2813. + ADD CONSTRAINT `FK_civicrm_contribution_contribution_type_id` FOREIGN KEY (`contribution_type_id`) REFERENCES `civicrm_contribution_type` (`id`),
  2814. ADD CONSTRAINT `FK_civicrm_contribution_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`),
  2815. - ADD CONSTRAINT `FK_civicrm_contribution_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
  2816. - ADD CONSTRAINT `FK_civicrm_contribution_solicitor_id` FOREIGN KEY (`solicitor_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL,
  2817. - ADD CONSTRAINT `FK_civicrm_contribution_contribution_type_id` FOREIGN KEY (`contribution_type_id`) REFERENCES `civicrm_contribution_type` (`id`) ON DELETE SET NULL,
  2818. - ADD CONSTRAINT `FK_civicrm_contribution_contribution_page_id` FOREIGN KEY (`contribution_page_id`) REFERENCES `civicrm_contribution_page` (`id`) ON DELETE SET NULL,
  2819. - ADD CONSTRAINT `FK_civicrm_contribution_contribution_recur_id` FOREIGN KEY (`contribution_recur_id`) REFERENCES `civicrm_contribution_recur` (`id`) ON DELETE SET NULL,
  2820. - ADD CONSTRAINT `FK_civicrm_contribution_honor_contact_id` FOREIGN KEY (`honor_contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL;
  2821. + ADD CONSTRAINT `FK_civicrm_contribution_honor_contact_id` FOREIGN KEY (`honor_contact_id`) REFERENCES `civicrm_contact` (`id`),
  2822. + ADD CONSTRAINT `FK_civicrm_contribution_solicitor_id` FOREIGN KEY (`solicitor_id`) REFERENCES `civicrm_contact` (`id`);
  2823.  
  2824. --
  2825. -- Constraints for table `civicrm_contribution_page`
  2826. --
  2827. ALTER TABLE `civicrm_contribution_page`
  2828. - ADD CONSTRAINT `FK_civicrm_contribution_page_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`),
  2829. ADD CONSTRAINT `FK_civicrm_contribution_page_contribution_type_id` FOREIGN KEY (`contribution_type_id`) REFERENCES `civicrm_contribution_type` (`id`),
  2830. - ADD CONSTRAINT `FK_civicrm_contribution_page_payment_processor_id` FOREIGN KEY (`payment_processor_id`) REFERENCES `civicrm_payment_processor` (`id`) ON DELETE SET NULL;
  2831. + ADD CONSTRAINT `FK_civicrm_contribution_page_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`),
  2832. + ADD CONSTRAINT `FK_civicrm_contribution_page_payment_processor_id` FOREIGN KEY (`payment_processor_id`) REFERENCES `civicrm_payment_processor` (`id`);
  2833.  
  2834. --
  2835. -- Constraints for table `civicrm_contribution_product`
  2836. --
  2837. ALTER TABLE `civicrm_contribution_product`
  2838. - ADD CONSTRAINT `FK_civicrm_contribution_product_contribution_id` FOREIGN KEY (`contribution_id`) REFERENCES `civicrm_contribution` (`id`) ON DELETE CASCADE;
  2839. + ADD CONSTRAINT `FK_civicrm_contribution_product_contribution_id` FOREIGN KEY (`contribution_id`) REFERENCES `civicrm_contribution` (`id`);
  2840.  
  2841. --
  2842. -- Constraints for table `civicrm_contribution_recur`
  2843. --
  2844. ALTER TABLE `civicrm_contribution_recur`
  2845. - ADD CONSTRAINT `FK_civicrm_contribution_recur_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`),
  2846. - ADD CONSTRAINT `FK_civicrm_contribution_recur_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE;
  2847. + ADD CONSTRAINT `FK_civicrm_contribution_recur_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`),
  2848. + ADD CONSTRAINT `FK_civicrm_contribution_recur_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`);
  2849.  
  2850. --
  2851. -- Constraints for table `civicrm_contribution_type`
  2852. @@ -2460,18 +2311,6 @@
  2853. ADD CONSTRAINT `FK_civicrm_contribution_type_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`);
  2854.  
  2855. --
  2856. --- Constraints for table `civicrm_contribution_widget`
  2857. ---
  2858. -ALTER TABLE `civicrm_contribution_widget`
  2859. - ADD CONSTRAINT `FK_civicrm_contribution_widget_contribution_page_id` FOREIGN KEY (`contribution_page_id`) REFERENCES `civicrm_contribution_page` (`id`) ON DELETE CASCADE;
  2860. -
  2861. ---
  2862. --- Constraints for table `civicrm_country`
  2863. ---
  2864. -ALTER TABLE `civicrm_country`
  2865. - ADD CONSTRAINT `FK_civicrm_country_region_id` FOREIGN KEY (`region_id`) REFERENCES `civicrm_worldregion` (`id`);
  2866. -
  2867. ---
  2868. -- Constraints for table `civicrm_county`
  2869. --
  2870. ALTER TABLE `civicrm_county`
  2871. @@ -2481,7 +2320,8 @@
  2872. -- Constraints for table `civicrm_custom_field`
  2873. --
  2874. ALTER TABLE `civicrm_custom_field`
  2875. - ADD CONSTRAINT `FK_civicrm_custom_field_custom_group_id` FOREIGN KEY (`custom_group_id`) REFERENCES `civicrm_custom_group` (`id`) ON DELETE CASCADE;
  2876. + ADD CONSTRAINT `FK_civicrm_custom_field_custom_group_id` FOREIGN KEY (`custom_group_id`) REFERENCES `civicrm_custom_group` (`id`),
  2877. + ADD CONSTRAINT `FK_civicrm_custom_field_validation_id` FOREIGN KEY (`validation_id`) REFERENCES `civicrm_validation` (`id`);
  2878.  
  2879. --
  2880. -- Constraints for table `civicrm_custom_group`
  2881. @@ -2490,6 +2330,13 @@
  2882. ADD CONSTRAINT `FK_civicrm_custom_group_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`);
  2883.  
  2884. --
  2885. +-- Constraints for table `civicrm_custom_value`
  2886. +--
  2887. +ALTER TABLE `civicrm_custom_value`
  2888. + ADD CONSTRAINT `FK_civicrm_custom_value_custom_field_id` FOREIGN KEY (`custom_field_id`) REFERENCES `civicrm_custom_field` (`id`),
  2889. + ADD CONSTRAINT `FK_civicrm_custom_value_file_id` FOREIGN KEY (`file_id`) REFERENCES `civicrm_file` (`id`);
  2890. +
  2891. +--
  2892. -- Constraints for table `civicrm_dedupe_rule`
  2893. --
  2894. ALTER TABLE `civicrm_dedupe_rule`
  2895. @@ -2511,7 +2358,13 @@
  2896. -- Constraints for table `civicrm_email`
  2897. --
  2898. ALTER TABLE `civicrm_email`
  2899. - ADD CONSTRAINT `FK_civicrm_email_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE;
  2900. + ADD CONSTRAINT `FK_civicrm_email_location_id` FOREIGN KEY (`location_id`) REFERENCES `civicrm_location` (`id`);
  2901. +
  2902. +--
  2903. +-- Constraints for table `civicrm_email_history`
  2904. +--
  2905. +ALTER TABLE `civicrm_email_history`
  2906. + ADD CONSTRAINT `FK_civicrm_email_history_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`);
  2907.  
  2908. --
  2909. -- Constraints for table `civicrm_entity_file`
  2910. @@ -2523,35 +2376,20 @@
  2911. -- Constraints for table `civicrm_entity_tag`
  2912. --
  2913. ALTER TABLE `civicrm_entity_tag`
  2914. - ADD CONSTRAINT `FK_civicrm_entity_tag_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
  2915. - ADD CONSTRAINT `FK_civicrm_entity_tag_tag_id` FOREIGN KEY (`tag_id`) REFERENCES `civicrm_tag` (`id`) ON DELETE CASCADE;
  2916. + ADD CONSTRAINT `FK_civicrm_entity_tag_tag_id` FOREIGN KEY (`tag_id`) REFERENCES `civicrm_tag` (`id`);
  2917.  
  2918. --
  2919. -- Constraints for table `civicrm_event`
  2920. --
  2921. ALTER TABLE `civicrm_event`
  2922. ADD CONSTRAINT `FK_civicrm_event_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`),
  2923. - ADD CONSTRAINT `FK_civicrm_event_payment_processor_id` FOREIGN KEY (`payment_processor_id`) REFERENCES `civicrm_payment_processor` (`id`) ON DELETE SET NULL,
  2924. - ADD CONSTRAINT `FK_civicrm_event_loc_block_id` FOREIGN KEY (`loc_block_id`) REFERENCES `civicrm_loc_block` (`id`) ON DELETE CASCADE;
  2925. -
  2926. ---
  2927. --- Constraints for table `civicrm_event_page`
  2928. ---
  2929. -ALTER TABLE `civicrm_event_page`
  2930. - ADD CONSTRAINT `FK_civicrm_event_page_event_id` FOREIGN KEY (`event_id`) REFERENCES `civicrm_event` (`id`) ON DELETE CASCADE;
  2931. + ADD CONSTRAINT `FK_civicrm_event_payment_processor_id` FOREIGN KEY (`payment_processor_id`) REFERENCES `civicrm_payment_processor` (`id`);
  2932.  
  2933. --
  2934. -- Constraints for table `civicrm_financial_trxn`
  2935. --
  2936. ALTER TABLE `civicrm_financial_trxn`
  2937. - ADD CONSTRAINT `FK_civicrm_financial_trxn_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`),
  2938. - ADD CONSTRAINT `FK_civicrm_financial_trxn_contribution_id` FOREIGN KEY (`contribution_id`) REFERENCES `civicrm_contribution` (`id`) ON DELETE CASCADE;
  2939. -
  2940. ---
  2941. --- Constraints for table `civicrm_grant`
  2942. ---
  2943. -ALTER TABLE `civicrm_grant`
  2944. - ADD CONSTRAINT `FK_civicrm_grant_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE;
  2945. + ADD CONSTRAINT `FK_civicrm_financial_trxn_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`);
  2946.  
  2947. --
  2948. -- Constraints for table `civicrm_group`
  2949. @@ -2564,79 +2402,72 @@
  2950. -- Constraints for table `civicrm_group_contact`
  2951. --
  2952. ALTER TABLE `civicrm_group_contact`
  2953. - ADD CONSTRAINT `FK_civicrm_group_contact_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`) ON DELETE CASCADE,
  2954. - ADD CONSTRAINT `FK_civicrm_group_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
  2955. - ADD CONSTRAINT `FK_civicrm_group_contact_location_id` FOREIGN KEY (`location_id`) REFERENCES `civicrm_loc_block` (`id`) ON DELETE SET NULL,
  2956. - ADD CONSTRAINT `FK_civicrm_group_contact_email_id` FOREIGN KEY (`email_id`) REFERENCES `civicrm_email` (`id`);
  2957. + ADD CONSTRAINT `FK_civicrm_group_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`),
  2958. + ADD CONSTRAINT `FK_civicrm_group_contact_email_id` FOREIGN KEY (`email_id`) REFERENCES `civicrm_email` (`id`),
  2959. + ADD CONSTRAINT `FK_civicrm_group_contact_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`),
  2960. + ADD CONSTRAINT `FK_civicrm_group_contact_location_id` FOREIGN KEY (`location_id`) REFERENCES `civicrm_location` (`id`);
  2961.  
  2962. --
  2963. --- Constraints for table `civicrm_group_nesting`
  2964. +-- Constraints for table `civicrm_household`
  2965. --
  2966. -ALTER TABLE `civicrm_group_nesting`
  2967. - ADD CONSTRAINT `FK_civicrm_group_nesting_child_group_id` FOREIGN KEY (`child_group_id`) REFERENCES `civicrm_group` (`id`),
  2968. - ADD CONSTRAINT `FK_civicrm_group_nesting_parent_group_id` FOREIGN KEY (`parent_group_id`) REFERENCES `civicrm_group` (`id`) ON DELETE CASCADE;
  2969. +ALTER TABLE `civicrm_household`
  2970. + ADD CONSTRAINT `FK_civicrm_household_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`),
  2971. + ADD CONSTRAINT `FK_civicrm_household_primary_contact_id` FOREIGN KEY (`primary_contact_id`) REFERENCES `civicrm_contact` (`id`);
  2972.  
  2973. --
  2974. --- Constraints for table `civicrm_group_organization`
  2975. +-- Constraints for table `civicrm_im`
  2976. --
  2977. -ALTER TABLE `civicrm_group_organization`
  2978. - ADD CONSTRAINT `FK_civicrm_group_organization_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`),
  2979. - ADD CONSTRAINT `FK_civicrm_group_organization_organization_id` FOREIGN KEY (`organization_id`) REFERENCES `civicrm_contact` (`id`);
  2980. +ALTER TABLE `civicrm_im`
  2981. + ADD CONSTRAINT `FK_civicrm_im_location_id` FOREIGN KEY (`location_id`) REFERENCES `civicrm_location` (`id`);
  2982.  
  2983. --
  2984. --- Constraints for table `civicrm_im`
  2985. +-- Constraints for table `civicrm_individual`
  2986. --
  2987. -ALTER TABLE `civicrm_im`
  2988. - ADD CONSTRAINT `FK_civicrm_im_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE;
  2989. +ALTER TABLE `civicrm_individual`
  2990. + ADD CONSTRAINT `FK_civicrm_individual_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`);
  2991.  
  2992. --
  2993. -- Constraints for table `civicrm_line_item`
  2994. --
  2995. ALTER TABLE `civicrm_line_item`
  2996. + ADD CONSTRAINT `FK_civicrm_line_item_custom_option_id` FOREIGN KEY (`custom_option_id`) REFERENCES `civicrm_custom_option` (`id`),
  2997. ADD CONSTRAINT `FK_civicrm_line_item_price_field_id` FOREIGN KEY (`price_field_id`) REFERENCES `civicrm_price_field` (`id`);
  2998.  
  2999. --
  3000. --- Constraints for table `civicrm_location_type`
  3001. +-- Constraints for table `civicrm_location`
  3002. --
  3003. -ALTER TABLE `civicrm_location_type`
  3004. - ADD CONSTRAINT `FK_civicrm_location_type_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`);
  3005. +ALTER TABLE `civicrm_location`
  3006. + ADD CONSTRAINT `FK_civicrm_location_location_type_id` FOREIGN KEY (`location_type_id`) REFERENCES `civicrm_location_type` (`id`);
  3007.  
  3008. --
  3009. --- Constraints for table `civicrm_loc_block`
  3010. +-- Constraints for table `civicrm_location_type`
  3011. --
  3012. -ALTER TABLE `civicrm_loc_block`
  3013. - ADD CONSTRAINT `FK_civicrm_loc_block_address_id` FOREIGN KEY (`address_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL,
  3014. - ADD CONSTRAINT `FK_civicrm_loc_block_email_id` FOREIGN KEY (`email_id`) REFERENCES `civicrm_email` (`id`) ON DELETE SET NULL,
  3015. - ADD CONSTRAINT `FK_civicrm_loc_block_phone_id` FOREIGN KEY (`phone_id`) REFERENCES `civicrm_phone` (`id`) ON DELETE SET NULL,
  3016. - ADD CONSTRAINT `FK_civicrm_loc_block_im_id` FOREIGN KEY (`im_id`) REFERENCES `civicrm_im` (`id`) ON DELETE SET NULL,
  3017. - ADD CONSTRAINT `FK_civicrm_loc_block_address_2_id` FOREIGN KEY (`address_2_id`) REFERENCES `civicrm_address` (`id`) ON DELETE SET NULL,
  3018. - ADD CONSTRAINT `FK_civicrm_loc_block_email_2_id` FOREIGN KEY (`email_2_id`) REFERENCES `civicrm_email` (`id`) ON DELETE SET NULL,
  3019. - ADD CONSTRAINT `FK_civicrm_loc_block_phone_2_id` FOREIGN KEY (`phone_2_id`) REFERENCES `civicrm_phone` (`id`) ON DELETE SET NULL,
  3020. - ADD CONSTRAINT `FK_civicrm_loc_block_im_2_id` FOREIGN KEY (`im_2_id`) REFERENCES `civicrm_im` (`id`) ON DELETE SET NULL;
  3021. +ALTER TABLE `civicrm_location_type`
  3022. + ADD CONSTRAINT `FK_civicrm_location_type_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`);
  3023.  
  3024. --
  3025. -- Constraints for table `civicrm_log`
  3026. --
  3027. ALTER TABLE `civicrm_log`
  3028. - ADD CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE;
  3029. + ADD CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`);
  3030.  
  3031. --
  3032. -- Constraints for table `civicrm_mailing`
  3033. --
  3034. ALTER TABLE `civicrm_mailing`
  3035. ADD CONSTRAINT `FK_civicrm_mailing_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`),
  3036. - ADD CONSTRAINT `FK_civicrm_mailing_header_id` FOREIGN KEY (`header_id`) REFERENCES `civicrm_mailing_component` (`id`) ON DELETE SET NULL,
  3037. - ADD CONSTRAINT `FK_civicrm_mailing_footer_id` FOREIGN KEY (`footer_id`) REFERENCES `civicrm_mailing_component` (`id`) ON DELETE SET NULL,
  3038. - ADD CONSTRAINT `FK_civicrm_mailing_reply_id` FOREIGN KEY (`reply_id`) REFERENCES `civicrm_mailing_component` (`id`) ON DELETE SET NULL,
  3039. - ADD CONSTRAINT `FK_civicrm_mailing_unsubscribe_id` FOREIGN KEY (`unsubscribe_id`) REFERENCES `civicrm_mailing_component` (`id`) ON DELETE SET NULL,
  3040. - ADD CONSTRAINT `FK_civicrm_mailing_optout_id` FOREIGN KEY (`optout_id`) REFERENCES `civicrm_mailing_component` (`id`) ON DELETE SET NULL,
  3041. - ADD CONSTRAINT `FK_civicrm_mailing_msg_template_id` FOREIGN KEY (`msg_template_id`) REFERENCES `civicrm_msg_template` (`id`) ON DELETE SET NULL;
  3042. + ADD CONSTRAINT `FK_civicrm_mailing_footer_id` FOREIGN KEY (`footer_id`) REFERENCES `civicrm_mailing_component` (`id`),
  3043. + ADD CONSTRAINT `FK_civicrm_mailing_header_id` FOREIGN KEY (`header_id`) REFERENCES `civicrm_mailing_component` (`id`),
  3044. + ADD CONSTRAINT `FK_civicrm_mailing_msg_template_id` FOREIGN KEY (`msg_template_id`) REFERENCES `civicrm_msg_template` (`id`),
  3045. + ADD CONSTRAINT `FK_civicrm_mailing_optout_id` FOREIGN KEY (`optout_id`) REFERENCES `civicrm_mailing_component` (`id`),
  3046. + ADD CONSTRAINT `FK_civicrm_mailing_reply_id` FOREIGN KEY (`reply_id`) REFERENCES `civicrm_mailing_component` (`id`),
  3047. + ADD CONSTRAINT `FK_civicrm_mailing_unsubscribe_id` FOREIGN KEY (`unsubscribe_id`) REFERENCES `civicrm_mailing_component` (`id`);
  3048.  
  3049. --
  3050. -- Constraints for table `civicrm_mailing_bounce_pattern`
  3051. --
  3052. ALTER TABLE `civicrm_mailing_bounce_pattern`
  3053. - ADD CONSTRAINT `FK_civicrm_mailing_bounce_pattern_bounce_type_id` FOREIGN KEY (`bounce_type_id`) REFERENCES `civicrm_mailing_bounce_type` (`id`) ON DELETE CASCADE;
  3054. + ADD CONSTRAINT `FK_civicrm_mailing_bounce_pattern_bounce_type_id` FOREIGN KEY (`bounce_type_id`) REFERENCES `civicrm_mailing_bounce_type` (`id`);
  3055.  
  3056. --
  3057. -- Constraints for table `civicrm_mailing_component`
  3058. @@ -2648,91 +2479,91 @@
  3059. -- Constraints for table `civicrm_mailing_event_bounce`
  3060. --
  3061. ALTER TABLE `civicrm_mailing_event_bounce`
  3062. - ADD CONSTRAINT `FK_civicrm_mailing_event_bounce_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`) ON DELETE CASCADE;
  3063. + ADD CONSTRAINT `FK_civicrm_mailing_event_bounce_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`);
  3064.  
  3065. --
  3066. -- Constraints for table `civicrm_mailing_event_confirm`
  3067. --
  3068. ALTER TABLE `civicrm_mailing_event_confirm`
  3069. - ADD CONSTRAINT `FK_civicrm_mailing_event_confirm_event_subscribe_id` FOREIGN KEY (`event_subscribe_id`) REFERENCES `civicrm_mailing_event_subscribe` (`id`) ON DELETE CASCADE;
  3070. + ADD CONSTRAINT `FK_civicrm_mailing_event_confirm_event_subscribe_id` FOREIGN KEY (`event_subscribe_id`) REFERENCES `civicrm_mailing_event_subscribe` (`id`);
  3071.  
  3072. --
  3073. -- Constraints for table `civicrm_mailing_event_delivered`
  3074. --
  3075. ALTER TABLE `civicrm_mailing_event_delivered`
  3076. - ADD CONSTRAINT `FK_civicrm_mailing_event_delivered_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`) ON DELETE CASCADE;
  3077. + ADD CONSTRAINT `FK_civicrm_mailing_event_delivered_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`);
  3078.  
  3079. --
  3080. -- Constraints for table `civicrm_mailing_event_forward`
  3081. --
  3082. ALTER TABLE `civicrm_mailing_event_forward`
  3083. - ADD CONSTRAINT `FK_civicrm_mailing_event_forward_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`) ON DELETE CASCADE,
  3084. - ADD CONSTRAINT `FK_civicrm_mailing_event_forward_dest_queue_id` FOREIGN KEY (`dest_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`);
  3085. + ADD CONSTRAINT `FK_civicrm_mailing_event_forward_dest_queue_id` FOREIGN KEY (`dest_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`),
  3086. + ADD CONSTRAINT `FK_civicrm_mailing_event_forward_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`);
  3087.  
  3088. --
  3089. -- Constraints for table `civicrm_mailing_event_opened`
  3090. --
  3091. ALTER TABLE `civicrm_mailing_event_opened`
  3092. - ADD CONSTRAINT `FK_civicrm_mailing_event_opened_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`) ON DELETE CASCADE;
  3093. + ADD CONSTRAINT `FK_civicrm_mailing_event_opened_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`);
  3094.  
  3095. --
  3096. -- Constraints for table `civicrm_mailing_event_queue`
  3097. --
  3098. ALTER TABLE `civicrm_mailing_event_queue`
  3099. - ADD CONSTRAINT `FK_civicrm_mailing_event_queue_job_id` FOREIGN KEY (`job_id`) REFERENCES `civicrm_mailing_job` (`id`) ON DELETE CASCADE,
  3100. - ADD CONSTRAINT `FK_civicrm_mailing_event_queue_email_id` FOREIGN KEY (`email_id`) REFERENCES `civicrm_email` (`id`) ON DELETE CASCADE,
  3101. - ADD CONSTRAINT `FK_civicrm_mailing_event_queue_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE;
  3102. + ADD CONSTRAINT `FK_civicrm_mailing_event_queue_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`),
  3103. + ADD CONSTRAINT `FK_civicrm_mailing_event_queue_email_id` FOREIGN KEY (`email_id`) REFERENCES `civicrm_email` (`id`),
  3104. + ADD CONSTRAINT `FK_civicrm_mailing_event_queue_job_id` FOREIGN KEY (`job_id`) REFERENCES `civicrm_mailing_job` (`id`);
  3105.  
  3106. --
  3107. -- Constraints for table `civicrm_mailing_event_reply`
  3108. --
  3109. ALTER TABLE `civicrm_mailing_event_reply`
  3110. - ADD CONSTRAINT `FK_civicrm_mailing_event_reply_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`) ON DELETE CASCADE;
  3111. + ADD CONSTRAINT `FK_civicrm_mailing_event_reply_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`);
  3112.  
  3113. --
  3114. -- Constraints for table `civicrm_mailing_event_subscribe`
  3115. --
  3116. ALTER TABLE `civicrm_mailing_event_subscribe`
  3117. - ADD CONSTRAINT `FK_civicrm_mailing_event_subscribe_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`) ON DELETE CASCADE,
  3118. - ADD CONSTRAINT `FK_civicrm_mailing_event_subscribe_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE;
  3119. + ADD CONSTRAINT `FK_civicrm_mailing_event_subscribe_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`),
  3120. + ADD CONSTRAINT `FK_civicrm_mailing_event_subscribe_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`);
  3121.  
  3122. --
  3123. -- Constraints for table `civicrm_mailing_event_trackable_url_open`
  3124. --
  3125. ALTER TABLE `civicrm_mailing_event_trackable_url_open`
  3126. - ADD CONSTRAINT `FK_civicrm_mailing_event_trackable_url_open_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`) ON DELETE CASCADE,
  3127. - ADD CONSTRAINT `FK_civicrm_mailing_event_trackable_url_open_trackable_url_id` FOREIGN KEY (`trackable_url_id`) REFERENCES `civicrm_mailing_trackable_url` (`id`) ON DELETE CASCADE;
  3128. + ADD CONSTRAINT `FK_civicrm_mailing_event_trackable_url_open_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`),
  3129. + ADD CONSTRAINT `FK_civicrm_mailing_event_trackable_url_open_trackable_url_id` FOREIGN KEY (`trackable_url_id`) REFERENCES `civicrm_mailing_trackable_url` (`id`);
  3130.  
  3131. --
  3132. -- Constraints for table `civicrm_mailing_event_unsubscribe`
  3133. --
  3134. ALTER TABLE `civicrm_mailing_event_unsubscribe`
  3135. - ADD CONSTRAINT `FK_civicrm_mailing_event_unsubscribe_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`) ON DELETE CASCADE;
  3136. + ADD CONSTRAINT `FK_civicrm_mailing_event_unsubscribe_event_queue_id` FOREIGN KEY (`event_queue_id`) REFERENCES `civicrm_mailing_event_queue` (`id`);
  3137.  
  3138. --
  3139. -- Constraints for table `civicrm_mailing_group`
  3140. --
  3141. ALTER TABLE `civicrm_mailing_group`
  3142. - ADD CONSTRAINT `FK_civicrm_mailing_group_mailing_id` FOREIGN KEY (`mailing_id`) REFERENCES `civicrm_mailing` (`id`) ON DELETE CASCADE;
  3143. + ADD CONSTRAINT `FK_civicrm_mailing_group_mailing_id` FOREIGN KEY (`mailing_id`) REFERENCES `civicrm_mailing` (`id`);
  3144.  
  3145. --
  3146. -- Constraints for table `civicrm_mailing_job`
  3147. --
  3148. ALTER TABLE `civicrm_mailing_job`
  3149. - ADD CONSTRAINT `FK_civicrm_mailing_job_mailing_id` FOREIGN KEY (`mailing_id`) REFERENCES `civicrm_mailing` (`id`) ON DELETE CASCADE;
  3150. + ADD CONSTRAINT `FK_civicrm_mailing_job_mailing_id` FOREIGN KEY (`mailing_id`) REFERENCES `civicrm_mailing` (`id`);
  3151.  
  3152. --
  3153. -- Constraints for table `civicrm_mailing_spool`
  3154. --
  3155. ALTER TABLE `civicrm_mailing_spool`
  3156. ADD CONSTRAINT `FK_civicrm_mailing_spool_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`),
  3157. - ADD CONSTRAINT `FK_civicrm_mailing_spool_job_id` FOREIGN KEY (`job_id`) REFERENCES `civicrm_mailing_job` (`id`) ON DELETE CASCADE;
  3158. + ADD CONSTRAINT `FK_civicrm_mailing_spool_job_id` FOREIGN KEY (`job_id`) REFERENCES `civicrm_mailing_job` (`id`);
  3159.  
  3160. --
  3161. -- Constraints for table `civicrm_mailing_trackable_url`
  3162. --
  3163. ALTER TABLE `civicrm_mailing_trackable_url`
  3164. - ADD CONSTRAINT `FK_civicrm_mailing_trackable_url_mailing_id` FOREIGN KEY (`mailing_id`) REFERENCES `civicrm_mailing` (`id`) ON DELETE CASCADE;
  3165. + ADD CONSTRAINT `FK_civicrm_mailing_trackable_url_mailing_id` FOREIGN KEY (`mailing_id`) REFERENCES `civicrm_mailing` (`id`);
  3166.  
  3167. --
  3168. -- Constraints for table `civicrm_mapping`
  3169. @@ -2744,18 +2575,25 @@
  3170. -- Constraints for table `civicrm_mapping_field`
  3171. --
  3172. ALTER TABLE `civicrm_mapping_field`
  3173. - ADD CONSTRAINT `FK_civicrm_mapping_field_mapping_id` FOREIGN KEY (`mapping_id`) REFERENCES `civicrm_mapping` (`id`),
  3174. ADD CONSTRAINT `FK_civicrm_mapping_field_location_type_id` FOREIGN KEY (`location_type_id`) REFERENCES `civicrm_location_type` (`id`),
  3175. + ADD CONSTRAINT `FK_civicrm_mapping_field_mapping_id` FOREIGN KEY (`mapping_id`) REFERENCES `civicrm_mapping` (`id`),
  3176. ADD CONSTRAINT `FK_civicrm_mapping_field_relationship_type_id` FOREIGN KEY (`relationship_type_id`) REFERENCES `civicrm_relationship_type` (`id`);
  3177.  
  3178. --
  3179. +-- Constraints for table `civicrm_meeting`
  3180. +--
  3181. +ALTER TABLE `civicrm_meeting`
  3182. + ADD CONSTRAINT `FK_civicrm_meeting_parent_id` FOREIGN KEY (`parent_id`) REFERENCES `civicrm_meeting` (`id`),
  3183. + ADD CONSTRAINT `FK_civicrm_meeting_source_contact_id` FOREIGN KEY (`source_contact_id`) REFERENCES `civicrm_contact` (`id`);
  3184. +
  3185. +--
  3186. -- Constraints for table `civicrm_membership`
  3187. --
  3188. ALTER TABLE `civicrm_membership`
  3189. - ADD CONSTRAINT `FK_civicrm_membership_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
  3190. - ADD CONSTRAINT `FK_civicrm_membership_membership_type_id` FOREIGN KEY (`membership_type_id`) REFERENCES `civicrm_membership_type` (`id`) ON DELETE CASCADE,
  3191. - ADD CONSTRAINT `FK_civicrm_membership_status_id` FOREIGN KEY (`status_id`) REFERENCES `civicrm_membership_status` (`id`) ON DELETE CASCADE,
  3192. - ADD CONSTRAINT `FK_civicrm_membership_owner_membership_id` FOREIGN KEY (`owner_membership_id`) REFERENCES `civicrm_membership` (`id`) ON DELETE SET NULL;
  3193. + ADD CONSTRAINT `FK_civicrm_membership_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`),
  3194. + ADD CONSTRAINT `FK_civicrm_membership_membership_type_id` FOREIGN KEY (`membership_type_id`) REFERENCES `civicrm_membership_type` (`id`),
  3195. + ADD CONSTRAINT `FK_civicrm_membership_owner_membership_id` FOREIGN KEY (`owner_membership_id`) REFERENCES `civicrm_membership` (`id`),
  3196. + ADD CONSTRAINT `FK_civicrm_membership_status_id` FOREIGN KEY (`status_id`) REFERENCES `civicrm_membership_status` (`id`);
  3197.  
  3198. --
  3199. -- Constraints for table `civicrm_membership_block`
  3200. @@ -2768,16 +2606,15 @@
  3201. -- Constraints for table `civicrm_membership_log`
  3202. --
  3203. ALTER TABLE `civicrm_membership_log`
  3204. - ADD CONSTRAINT `FK_civicrm_membership_log_membership_id` FOREIGN KEY (`membership_id`) REFERENCES `civicrm_membership` (`id`) ON DELETE CASCADE,
  3205. - ADD CONSTRAINT `FK_civicrm_membership_log_status_id` FOREIGN KEY (`status_id`) REFERENCES `civicrm_membership_status` (`id`) ON DELETE CASCADE,
  3206. - ADD CONSTRAINT `FK_civicrm_membership_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL;
  3207. + ADD CONSTRAINT `FK_civicrm_membership_log_membership_id` FOREIGN KEY (`membership_id`) REFERENCES `civicrm_membership` (`id`),
  3208. + ADD CONSTRAINT `FK_civicrm_membership_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`),
  3209. + ADD CONSTRAINT `FK_civicrm_membership_log_status_id` FOREIGN KEY (`status_id`) REFERENCES `civicrm_membership_status` (`id`);
  3210.  
  3211. --
  3212. -- Constraints for table `civicrm_membership_payment`
  3213. --
  3214. ALTER TABLE `civicrm_membership_payment`
  3215. - ADD CONSTRAINT `FK_civicrm_membership_payment_membership_id` FOREIGN KEY (`membership_id`) REFERENCES `civicrm_membership` (`id`) ON DELETE CASCADE,
  3216. - ADD CONSTRAINT `FK_civicrm_membership_payment_contribution_id` FOREIGN KEY (`contribution_id`) REFERENCES `civicrm_contribution` (`id`) ON DELETE CASCADE;
  3217. + ADD CONSTRAINT `FK_civicrm_membership_payment_membership_id` FOREIGN KEY (`membership_id`) REFERENCES `civicrm_membership` (`id`);
  3218.  
  3219. --
  3220. -- Constraints for table `civicrm_membership_status`
  3221. @@ -2789,9 +2626,9 @@
  3222. -- Constraints for table `civicrm_membership_type`
  3223. --
  3224. ALTER TABLE `civicrm_membership_type`
  3225. + ADD CONSTRAINT `FK_civicrm_membership_type_contribution_type_id` FOREIGN KEY (`contribution_type_id`) REFERENCES `civicrm_contribution_type` (`id`),
  3226. ADD CONSTRAINT `FK_civicrm_membership_type_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`),
  3227. ADD CONSTRAINT `FK_civicrm_membership_type_member_of_contact_id` FOREIGN KEY (`member_of_contact_id`) REFERENCES `civicrm_contact` (`id`),
  3228. - ADD CONSTRAINT `FK_civicrm_membership_type_contribution_type_id` FOREIGN KEY (`contribution_type_id`) REFERENCES `civicrm_contribution_type` (`id`),
  3229. ADD CONSTRAINT `FK_civicrm_membership_type_relationship_type_id` FOREIGN KEY (`relationship_type_id`) REFERENCES `civicrm_relationship_type` (`id`),
  3230. ADD CONSTRAINT `FK_civicrm_membership_type_renewal_msg_id` FOREIGN KEY (`renewal_msg_id`) REFERENCES `civicrm_msg_template` (`id`);
  3231.  
  3232. @@ -2808,12 +2645,6 @@
  3233. ADD CONSTRAINT `FK_civicrm_note_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`);
  3234.  
  3235. --
  3236. --- Constraints for table `civicrm_openid`
  3237. ---
  3238. -ALTER TABLE `civicrm_openid`
  3239. - ADD CONSTRAINT `FK_civicrm_openid_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE;
  3240. -
  3241. ---
  3242. -- Constraints for table `civicrm_option_group`
  3243. --
  3244. ALTER TABLE `civicrm_option_group`
  3245. @@ -2823,22 +2654,27 @@
  3246. -- Constraints for table `civicrm_option_value`
  3247. --
  3248. ALTER TABLE `civicrm_option_value`
  3249. - ADD CONSTRAINT `FK_civicrm_option_value_option_group_id` FOREIGN KEY (`option_group_id`) REFERENCES `civicrm_option_group` (`id`) ON DELETE CASCADE,
  3250. - ADD CONSTRAINT `FK_civicrm_option_value_component_id` FOREIGN KEY (`component_id`) REFERENCES `civicrm_component` (`id`);
  3251. + ADD CONSTRAINT `FK_civicrm_option_value_option_group_id` FOREIGN KEY (`option_group_id`) REFERENCES `civicrm_option_group` (`id`);
  3252. +
  3253. +--
  3254. +-- Constraints for table `civicrm_organization`
  3255. +--
  3256. +ALTER TABLE `civicrm_organization`
  3257. + ADD CONSTRAINT `FK_civicrm_organization_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`),
  3258. + ADD CONSTRAINT `FK_civicrm_organization_primary_contact_id` FOREIGN KEY (`primary_contact_id`) REFERENCES `civicrm_contact` (`id`);
  3259.  
  3260. --
  3261. -- Constraints for table `civicrm_participant`
  3262. --
  3263. ALTER TABLE `civicrm_participant`
  3264. - ADD CONSTRAINT `FK_civicrm_participant_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
  3265. - ADD CONSTRAINT `FK_civicrm_participant_event_id` FOREIGN KEY (`event_id`) REFERENCES `civicrm_event` (`id`) ON DELETE CASCADE;
  3266. + ADD CONSTRAINT `FK_civicrm_participant_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`),
  3267. + ADD CONSTRAINT `FK_civicrm_participant_event_id` FOREIGN KEY (`event_id`) REFERENCES `civicrm_event` (`id`);
  3268.  
  3269. --
  3270. -- Constraints for table `civicrm_participant_payment`
  3271. --
  3272. ALTER TABLE `civicrm_participant_payment`
  3273. - ADD CONSTRAINT `FK_civicrm_participant_payment_participant_id` FOREIGN KEY (`participant_id`) REFERENCES `civicrm_participant` (`id`) ON DELETE CASCADE,
  3274. - ADD CONSTRAINT `FK_civicrm_participant_payment_contribution_id` FOREIGN KEY (`contribution_id`) REFERENCES `civicrm_contribution` (`id`) ON DELETE CASCADE;
  3275. + ADD CONSTRAINT `FK_civicrm_participant_payment_participant_id` FOREIGN KEY (`participant_id`) REFERENCES `civicrm_participant` (`id`);
  3276.  
  3277. --
  3278. -- Constraints for table `civicrm_payment_processor`
  3279. @@ -2856,20 +2692,22 @@
  3280. -- Constraints for table `civicrm_phone`
  3281. --
  3282. ALTER TABLE `civicrm_phone`
  3283. - ADD CONSTRAINT `FK_civicrm_phone_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE;
  3284. + ADD CONSTRAINT `FK_civicrm_phone_location_id` FOREIGN KEY (`location_id`) REFERENCES `civicrm_location` (`id`);
  3285.  
  3286. --
  3287. --- Constraints for table `civicrm_preferences`
  3288. +-- Constraints for table `civicrm_phonecall`
  3289. --
  3290. -ALTER TABLE `civicrm_preferences`
  3291. - ADD CONSTRAINT `FK_civicrm_preferences_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`),
  3292. - ADD CONSTRAINT `FK_civicrm_preferences_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`);
  3293. +ALTER TABLE `civicrm_phonecall`
  3294. + ADD CONSTRAINT `FK_civicrm_phonecall_parent_id` FOREIGN KEY (`parent_id`) REFERENCES `civicrm_phonecall` (`id`),
  3295. + ADD CONSTRAINT `FK_civicrm_phonecall_phone_id` FOREIGN KEY (`phone_id`) REFERENCES `civicrm_phone` (`id`),
  3296. + ADD CONSTRAINT `FK_civicrm_phonecall_source_contact_id` FOREIGN KEY (`source_contact_id`) REFERENCES `civicrm_contact` (`id`);
  3297.  
  3298. --
  3299. --- Constraints for table `civicrm_preferences_date`
  3300. +-- Constraints for table `civicrm_preferences`
  3301. --
  3302. -ALTER TABLE `civicrm_preferences_date`
  3303. - ADD CONSTRAINT `FK_civicrm_preferences_date_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`);
  3304. +ALTER TABLE `civicrm_preferences`
  3305. + ADD CONSTRAINT `FK_civicrm_preferences_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`),
  3306. + ADD CONSTRAINT `FK_civicrm_preferences_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`);
  3307.  
  3308. --
  3309. -- Constraints for table `civicrm_premiums_product`
  3310. @@ -2912,9 +2750,9 @@
  3311. -- Constraints for table `civicrm_relationship`
  3312. --
  3313. ALTER TABLE `civicrm_relationship`
  3314. - ADD CONSTRAINT `FK_civicrm_relationship_contact_id_a` FOREIGN KEY (`contact_id_a`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
  3315. - ADD CONSTRAINT `FK_civicrm_relationship_contact_id_b` FOREIGN KEY (`contact_id_b`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
  3316. - ADD CONSTRAINT `FK_civicrm_relationship_relationship_type_id` FOREIGN KEY (`relationship_type_id`) REFERENCES `civicrm_relationship_type` (`id`) ON DELETE CASCADE;
  3317. + ADD CONSTRAINT `FK_civicrm_relationship_contact_id_a` FOREIGN KEY (`contact_id_a`) REFERENCES `civicrm_contact` (`id`),
  3318. + ADD CONSTRAINT `FK_civicrm_relationship_contact_id_b` FOREIGN KEY (`contact_id_b`) REFERENCES `civicrm_contact` (`id`),
  3319. + ADD CONSTRAINT `FK_civicrm_relationship_relationship_type_id` FOREIGN KEY (`relationship_type_id`) REFERENCES `civicrm_relationship_type` (`id`);
  3320.  
  3321. --
  3322. -- Constraints for table `civicrm_relationship_type`
  3323. @@ -2929,6 +2767,12 @@
  3324. ADD CONSTRAINT `FK_civicrm_saved_search_mapping_id` FOREIGN KEY (`mapping_id`) REFERENCES `civicrm_mapping` (`id`);
  3325.  
  3326. --
  3327. +-- Constraints for table `civicrm_sms_history`
  3328. +--
  3329. +ALTER TABLE `civicrm_sms_history`
  3330. + ADD CONSTRAINT `FK_civicrm_sms_history_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`);
  3331. +
  3332. +--
  3333. -- Constraints for table `civicrm_state_province`
  3334. --
  3335. ALTER TABLE `civicrm_state_province`
  3336. @@ -2938,8 +2782,8 @@
  3337. -- Constraints for table `civicrm_subscription_history`
  3338. --
  3339. ALTER TABLE `civicrm_subscription_history`
  3340. - ADD CONSTRAINT `FK_civicrm_subscription_history_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
  3341. - ADD CONSTRAINT `FK_civicrm_subscription_history_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`) ON DELETE CASCADE;
  3342. + ADD CONSTRAINT `FK_civicrm_subscription_history_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`),
  3343. + ADD CONSTRAINT `FK_civicrm_subscription_history_group_id` FOREIGN KEY (`group_id`) REFERENCES `civicrm_group` (`id`);
  3344.  
  3345. --
  3346. -- Constraints for table `civicrm_tag`
  3347. @@ -2961,25 +2805,19 @@
  3348. ADD CONSTRAINT `FK_civicrm_task_status_task_id` FOREIGN KEY (`task_id`) REFERENCES `civicrm_task` (`id`);
  3349.  
  3350. --
  3351. --- Constraints for table `civicrm_timezone`
  3352. ---
  3353. -ALTER TABLE `civicrm_timezone`
  3354. - ADD CONSTRAINT `FK_civicrm_timezone_country_id` FOREIGN KEY (`country_id`) REFERENCES `civicrm_country` (`id`);
  3355. -
  3356. ---
  3357. -- Constraints for table `civicrm_uf_field`
  3358. --
  3359. ALTER TABLE `civicrm_uf_field`
  3360. - ADD CONSTRAINT `FK_civicrm_uf_field_uf_group_id` FOREIGN KEY (`uf_group_id`) REFERENCES `civicrm_uf_group` (`id`) ON DELETE CASCADE,
  3361. - ADD CONSTRAINT `FK_civicrm_uf_field_location_type_id` FOREIGN KEY (`location_type_id`) REFERENCES `civicrm_location_type` (`id`) ON DELETE SET NULL;
  3362. + ADD CONSTRAINT `FK_civicrm_uf_field_location_type_id` FOREIGN KEY (`location_type_id`) REFERENCES `civicrm_location_type` (`id`),
  3363. + ADD CONSTRAINT `FK_civicrm_uf_field_uf_group_id` FOREIGN KEY (`uf_group_id`) REFERENCES `civicrm_uf_group` (`id`);
  3364.  
  3365. --
  3366. -- Constraints for table `civicrm_uf_group`
  3367. --
  3368. ALTER TABLE `civicrm_uf_group`
  3369. + ADD CONSTRAINT `FK_civicrm_uf_group_add_to_group_id` FOREIGN KEY (`add_to_group_id`) REFERENCES `civicrm_group` (`id`),
  3370. ADD CONSTRAINT `FK_civicrm_uf_group_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`),
  3371. - ADD CONSTRAINT `FK_civicrm_uf_group_limit_listings_group_id` FOREIGN KEY (`limit_listings_group_id`) REFERENCES `civicrm_group` (`id`) ON DELETE SET NULL,
  3372. - ADD CONSTRAINT `FK_civicrm_uf_group_add_to_group_id` FOREIGN KEY (`add_to_group_id`) REFERENCES `civicrm_group` (`id`) ON DELETE SET NULL;
  3373. + ADD CONSTRAINT `FK_civicrm_uf_group_limit_listings_group_id` FOREIGN KEY (`limit_listings_group_id`) REFERENCES `civicrm_group` (`id`);
  3374.  
  3375. --
  3376. -- Constraints for table `civicrm_uf_join`
  3377. @@ -2991,5 +2829,11 @@
  3378. -- Constraints for table `civicrm_uf_match`
  3379. --
  3380. ALTER TABLE `civicrm_uf_match`
  3381. - ADD CONSTRAINT `FK_civicrm_uf_match_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE,
  3382. + ADD CONSTRAINT `FK_civicrm_uf_match_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`),
  3383. ADD CONSTRAINT `FK_civicrm_uf_match_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`);
  3384. +
  3385. +--
  3386. +-- Constraints for table `civicrm_validation`
  3387. +--
  3388. +ALTER TABLE `civicrm_validation`
  3389. + ADD CONSTRAINT `FK_civicrm_validation_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`);
  3390.  
  3391.  
Advertisement
Add Comment
Please, Sign In to add comment