-- +--------------------------------------------------------------------+
-- | Copyright CiviCRM LLC. All rights reserved.                        |
-- |                                                                    |
-- | This work is published under the GNU AGPLv3 license with some      |
-- | permitted exceptions and without any warranty. For full license    |
-- | and copyright information, see https://civicrm.org/licensing       |
-- +--------------------------------------------------------------------+
--
-- Generated from schema.tpl
-- DO NOT EDIT.  Generated by CRM_Core_CodeGen
--
-- /*******************************************************
-- *
-- * Clean up the existing tables - this section generated from drop.tpl
-- *
-- *******************************************************/



-- /*******************************************************
-- *
-- * Create new tables
-- *
-- *******************************************************/

-- /*******************************************************
-- *
-- * civicrm_msg_template_data
-- *
-- * Sample data for Better Message Templates extension
-- *
-- *******************************************************/
CREATE TABLE `civicrm_msg_template_data` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique MessageTemplateData ID',
  `msg_template_id` int unsigned NOT NULL COMMENT 'FK to MessageTemplate',
  `sample_name` varchar(128) NOT NULL COMMENT 'Name for the sample data',
  `msg_variables` text NOT NULL COMMENT 'Template variables and values',
  `is_capture` tinyint NOT NULL DEFAULT 1 COMMENT 'Was this sample captured?',
  `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'When the sample was created',
  PRIMARY KEY (`id`),
  UNIQUE INDEX `name_per_tpl`(msg_template_id, sample_name),
  CONSTRAINT FK_civicrm_msg_template_data_msg_template_id FOREIGN KEY (`msg_template_id`) REFERENCES `civicrm_msg_template`(`id`) ON DELETE CASCADE
)
ENGINE=InnoDB;
