-- +--------------------------------------------------------------------+
-- | 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_event_message_rules
-- *
-- * Event Messages Rule Entity
-- *
-- *******************************************************/
CREATE TABLE `civicrm_event_message_rules` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique EventMessageRule ID',
  `event_id` int unsigned NOT NULL COMMENT 'FK to Event',
  `is_active` tinyint DEFAULT NULL COMMENT 'is this rule active',
  `template_id` int unsigned NOT NULL COMMENT 'civicrm_message_template to be used',
  `from_status` varchar(255) DEFAULT NULL COMMENT 'list of (previous) participant status IDs',
  `to_status` varchar(255) DEFAULT NULL COMMENT 'list of (future) participant status IDs',
  `languages` varchar(255) DEFAULT NULL COMMENT 'list of languages',
  `roles` varchar(255) DEFAULT NULL COMMENT 'list of roles',
  `weight` int DEFAULT NULL COMMENT 'list of weights defining the order',
  `attachments` text DEFAULT NULL COMMENT 'list of attachments',
  PRIMARY KEY (`id`),
  INDEX `INDEX_is_active`(is_active),
  CONSTRAINT FK_civicrm_event_message_rules_event_id FOREIGN KEY (`event_id`) REFERENCES `civicrm_event`(`id`) ON DELETE CASCADE,
  CONSTRAINT FK_civicrm_event_message_rules_template_id FOREIGN KEY (`template_id`) REFERENCES `civicrm_msg_template`(`id`) ON DELETE CASCADE
)
ENGINE=InnoDB;
