Merge pull request #15543 from MegaphoneJon/reporting-22
[civicrm-core.git] / xml / templates / schema.tpl
index bbaa34e2535fa7f51b60eaf89b62e6c3007302a5..9a4e2ed49e6f2e2099b31e277183c5b721a60322 100644 (file)
@@ -1,7 +1,7 @@
 -- +--------------------------------------------------------------------+
--- | CiviCRM version 4.7                                                |
+-- | CiviCRM version 5                                                  |
 -- +--------------------------------------------------------------------+
--- | Copyright CiviCRM LLC (c) 2004-2016                                |
+-- | Copyright CiviCRM LLC (c) 2004-2019                                |
 -- +--------------------------------------------------------------------+
 -- | This file is a part of CiviCRM.                                    |
 -- |                                                                    |
@@ -59,7 +59,8 @@ CREATE TABLE `{$table.name}` (
 {if ! $first},{/if}
 {assign var='first' value=false}
 
-    PRIMARY KEY ( `{$table.primaryKey.name}` )
+    {assign var='firstIndexField' value=true}
+    PRIMARY KEY ({foreach from=$table.primaryKey.field item=fieldName}{if $firstIndexField}{assign var='firstIndexField' value=false}{else},{/if}`{$fieldName}`{/foreach})
 {/if} {* table.primaryKey *}
 
 {if $table.index}