-- MySQL dump 10.13  Distrib 5.5.53, for debian-linux-gnu (x86_64)
--
-- Host: localhost    Database: cafe-new
-- ------------------------------------------------------
-- Server version	5.5.53-0+deb8u1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `bfcms_acl_permissions`
--

DROP TABLE IF EXISTS `bfcms_acl_permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_acl_permissions` (
  `name` varchar(32) NOT NULL,
  `description` text,
  `custom` tinyint(1) DEFAULT '1',
  `modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Custom User Permissions';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_acl_resources`
--

DROP TABLE IF EXISTS `bfcms_acl_resources`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_acl_resources` (
  `name` varchar(32) NOT NULL,
  `inherit_from` varchar(32) DEFAULT NULL,
  `description` text,
  `modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` varchar(32) DEFAULT 'system',
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_acl_role_permissions`
--

DROP TABLE IF EXISTS `bfcms_acl_role_permissions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_acl_role_permissions` (
  `role` varchar(32) NOT NULL,
  `resource` varchar(32) NOT NULL,
  `type` tinyint(1) DEFAULT '0' COMMENT '"0 = Deny, 1 = Allow"',
  `permission` varchar(32) NOT NULL DEFAULT 'all',
  `modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` varchar(32) DEFAULT 'system',
  PRIMARY KEY (`resource`,`role`,`permission`),
  KEY `rolesfk` (`role`),
  KEY `permissionfk` (`permission`),
  CONSTRAINT `permissionfk` FOREIGN KEY (`permission`) REFERENCES `bfcms_acl_permissions` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `resourcefk` FOREIGN KEY (`resource`) REFERENCES `bfcms_acl_resources` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `rolesfk` FOREIGN KEY (`role`) REFERENCES `bfcms_acl_roles` (`name`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_acl_roles`
--

DROP TABLE IF EXISTS `bfcms_acl_roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_acl_roles` (
  `name` varchar(32) NOT NULL,
  `inherit_from` varchar(32) DEFAULT NULL,
  `description` text,
  `modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` varchar(32) DEFAULT 'system',
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Access Control List Roles';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_ad_injection`
--

DROP TABLE IF EXISTS `bfcms_ad_injection`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_ad_injection` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `target` varchar(32) NOT NULL DEFAULT 'default',
  `placement` int(10) unsigned NOT NULL DEFAULT '0',
  `position` int(10) unsigned NOT NULL DEFAULT '0',
  `created_on` datetime DEFAULT NULL,
  `created_by` varchar(128) DEFAULT NULL,
  `modified_on` timestamp NULL DEFAULT NULL,
  `modified_by` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_ad_manager`
--

DROP TABLE IF EXISTS `bfcms_ad_manager`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_ad_manager` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `client` varchar(64) DEFAULT NULL,
  `campaign` varchar(32) DEFAULT NULL,
  `placement` int(10) unsigned NOT NULL,
  `revenue_type` varchar(16) NOT NULL DEFAULT 'CPM',
  `media_mime_type` varchar(64) DEFAULT NULL,
  `media_type` varchar(16) NOT NULL,
  `media` mediumtext,
  `failover` varchar(255) DEFAULT NULL,
  `clickthrough_url` varchar(255) NOT NULL,
  `impressions` bigint(20) unsigned NOT NULL DEFAULT '0',
  `views` bigint(20) unsigned NOT NULL DEFAULT '0',
  `clicks` bigint(20) unsigned NOT NULL DEFAULT '0',
  `failover_impressions` int(11) unsigned NOT NULL DEFAULT '0',
  `failover_clicks` int(11) unsigned NOT NULL DEFAULT '0',
  `failover_views` int(11) unsigned NOT NULL DEFAULT '0',
  `start_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `hard_end_date` date DEFAULT NULL,
  `max_impressions` bigint(20) DEFAULT '0',
  `max_clicks` int(11) NOT NULL DEFAULT '0',
  `max_views` int(11) DEFAULT '0',
  `last_impression` datetime DEFAULT NULL,
  `last_impression_url` varchar(255) DEFAULT NULL,
  `last_click_url` varchar(255) DEFAULT NULL,
  `last_click` datetime DEFAULT NULL,
  `enabled` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `verified` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `completed` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `completed_on` datetime DEFAULT NULL,
  `premature` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `stopped_on` datetime DEFAULT NULL,
  `enable_analytics` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `analytics_category` varchar(32) DEFAULT NULL,
  `analytics_label` varchar(32) DEFAULT NULL,
  `comments` text,
  `created_on` datetime DEFAULT NULL,
  `created_by` varchar(128) DEFAULT NULL,
  `modified_on` timestamp NULL DEFAULT NULL,
  `modified_by` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_ad_placement`
--

DROP TABLE IF EXISTS `bfcms_ad_placement`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_ad_placement` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(64) NOT NULL,
  `width` int(10) unsigned NOT NULL,
  `height` int(10) unsigned NOT NULL,
  `allow_multiple_ads` tinyint(1) DEFAULT '0',
  `custom1` varchar(64) DEFAULT NULL,
  `custom2` varchar(64) DEFAULT NULL,
  `custom_int1` int(11) DEFAULT NULL,
  `custom_int2` int(11) DEFAULT NULL,
  `custom_flag1` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `custom_flag2` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `created_on` datetime DEFAULT NULL,
  `created_by` varchar(128) DEFAULT NULL,
  `modified_on` timestamp NULL DEFAULT NULL,
  `modified_by` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_cart`
--

DROP TABLE IF EXISTS `bfcms_cart`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_cart` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(128) DEFAULT NULL,
  `details_billing` int(10) unsigned DEFAULT NULL,
  `details_shipping` int(10) unsigned DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `modified_on` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4775 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_cart_products`
--

DROP TABLE IF EXISTS `bfcms_cart_products`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_cart_products` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cart` int(11) NOT NULL,
  `product` varchar(32) NOT NULL,
  `quantity` int(10) unsigned NOT NULL DEFAULT '0',
  `amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `campaign` varchar(64) DEFAULT NULL,
  `appeal` varchar(64) DEFAULT NULL,
  `motcode` varchar(64) DEFAULT NULL,
  `modified_on` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_cell`
--

DROP TABLE IF EXISTS `bfcms_cell`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_cell` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(32) DEFAULT 'base',
  `template` varchar(32) DEFAULT NULL,
  `style` varchar(32) DEFAULT NULL,
  `params` longtext,
  `search_content` text,
  `name` varchar(64) DEFAULT NULL,
  `section` varchar(32) DEFAULT NULL,
  `description` text,
  `placeable` tinyint(1) DEFAULT '1' COMMENT '''Whether this is a featurette that can be placed on a page (usually meaning it is NOT body copy)''',
  `created_by` varchar(128) DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `modified_by` varchar(128) DEFAULT NULL,
  `modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `enabled` tinyint(1) DEFAULT '1',
  `published` tinyint(1) DEFAULT '0',
  `acl_resource` varchar(32) DEFAULT NULL,
  `preferred_target` varchar(32) DEFAULT NULL,
  `prevent_listing` tinyint(1) DEFAULT '0',
  `e_char1` varchar(64) DEFAULT NULL,
  `e_char2` varchar(64) DEFAULT NULL,
  `e_char3` varchar(255) DEFAULT NULL,
  `e_char4` varchar(255) DEFAULT NULL,
  `e_text1` mediumtext,
  `e_text2` mediumtext,
  `e_int1` int(11) DEFAULT '0',
  `e_int2` int(11) DEFAULT '0',
  `e_dec1` decimal(12,2) DEFAULT '0.00',
  `e_dec2` decimal(12,2) DEFAULT '0.00',
  `e_flag1` tinyint(1) DEFAULT '0',
  `e_flag2` tinyint(1) DEFAULT NULL,
  `e_date1` datetime DEFAULT NULL,
  `e_date2` datetime DEFAULT NULL,
  `revision` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `bfcms_cell_acl_resource` (`acl_resource`),
  CONSTRAINT `bfcms_cell_acl_resource` FOREIGN KEY (`acl_resource`) REFERENCES `bfcms_acl_resources` (`name`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3936 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_cell_placement`
--

DROP TABLE IF EXISTS `bfcms_cell_placement`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_cell_placement` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cell` int(11) NOT NULL,
  `tag` varchar(32) DEFAULT NULL,
  `page` int(11) DEFAULT NULL,
  `preferred_target` varchar(32) DEFAULT 'default',
  `preferred_sort_order` int(11) DEFAULT '0',
  `created_on` datetime DEFAULT NULL,
  `modified_by` varchar(32) DEFAULT NULL,
  `modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `all` tinyint(1) DEFAULT '0',
  `preferred_style` varchar(32) DEFAULT NULL,
  `preferred_template` varchar(32) DEFAULT NULL,
  `enabled` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `cp_uniqcell` (`cell`,`tag`,`page`,`all`),
  KEY `cp_page` (`page`),
  CONSTRAINT `cp_cell` FOREIGN KEY (`cell`) REFERENCES `bfcms_cell` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `cp_page` FOREIGN KEY (`page`) REFERENCES `bfcms_page` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3719 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_cell_product`
--

DROP TABLE IF EXISTS `bfcms_cell_product`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_cell_product` (
  `cell` int(11) NOT NULL,
  `sku` varchar(32) NOT NULL,
  PRIMARY KEY (`cell`,`sku`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_cell_tag`
--

DROP TABLE IF EXISTS `bfcms_cell_tag`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_cell_tag` (
  `cell` int(11) NOT NULL,
  `tag` varchar(64) NOT NULL,
  `modified_on` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`cell`,`tag`),
  KEY `bfct_tag_cell` (`cell`),
  CONSTRAINT `bfct_tag_cell` FOREIGN KEY (`cell`) REFERENCES `bfcms_cell` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_cell_targetting`
--

DROP TABLE IF EXISTS `bfcms_cell_targetting`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_cell_targetting` (
  `cell` int(11) NOT NULL,
  `username` varchar(128) CHARACTER SET latin1 NOT NULL,
  `can_create` tinyint(1) DEFAULT '0',
  `can_read` tinyint(1) DEFAULT '0',
  `can_update` tinyint(1) DEFAULT '0',
  `can_delete` tinyint(1) DEFAULT '0',
  `modified_on` timestamp NULL DEFAULT NULL,
  `modified_by` varchar(128) CHARACTER SET latin1 DEFAULT 'system',
  PRIMARY KEY (`cell`,`username`),
  KEY `bfct_cell` (`cell`),
  CONSTRAINT `bfct_cell` FOREIGN KEY (`cell`) REFERENCES `bfcms_cell` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_config`
--

DROP TABLE IF EXISTS `bfcms_config`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_config` (
  `category` varchar(64) NOT NULL,
  `subcategory` varchar(64) NOT NULL,
  `key` varchar(255) NOT NULL,
  `value` text,
  `modified_on` datetime DEFAULT NULL,
  `modified_by` varchar(128) DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `created_by` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`category`,`key`,`subcategory`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_event`
--

DROP TABLE IF EXISTS `bfcms_event`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_event` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `acl_resource` varchar(32) DEFAULT NULL,
  `parent_event_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(64) NOT NULL,
  `teaser` varchar(255) DEFAULT NULL,
  `description` mediumtext,
  `detail_image_location` varchar(255) DEFAULT NULL,
  `location_details` int(10) unsigned DEFAULT NULL,
  `starts_on` datetime NOT NULL,
  `ends_on` datetime NOT NULL,
  `all_day_event` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `recurrence_days` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'The number of days between recurrences of this event',
  `admission_deadline` datetime DEFAULT NULL,
  `admission_details` int(10) unsigned DEFAULT NULL,
  `admission_cost` decimal(12,2) NOT NULL DEFAULT '0.00',
  `admission_cost_late` decimal(12,2) DEFAULT NULL,
  `admission_spots_available` int(6) NOT NULL DEFAULT '0',
  `admission_spots_taken` int(6) NOT NULL DEFAULT '0',
  `created_on` datetime DEFAULT NULL,
  `created_by` varchar(128) NOT NULL DEFAULT 'system',
  `modified_on` timestamp NULL DEFAULT NULL,
  `modified_by` varchar(128) NOT NULL DEFAULT 'system',
  `params` mediumtext,
  `template` varchar(32) NOT NULL DEFAULT 'default',
  `style` varchar(32) NOT NULL DEFAULT 'empty',
  `enabled` tinyint(1) NOT NULL DEFAULT '0',
  `optional1` varchar(255) DEFAULT NULL COMMENT 'Optional value for expansion',
  `optional2` varchar(255) DEFAULT NULL COMMENT 'Optional value for expansion',
  `optional3` varchar(255) DEFAULT NULL COMMENT 'Optional value for expansion',
  `optional4` varchar(255) DEFAULT NULL COMMENT 'Optional value for expansion',
  `optional5` varchar(255) DEFAULT NULL,
  `optional6` varchar(255) DEFAULT NULL,
  `date1` datetime DEFAULT NULL COMMENT 'Optional date for expansion',
  `date2` datetime DEFAULT NULL COMMENT 'Optional date for expansion',
  `date3` datetime DEFAULT NULL,
  `date4` datetime DEFAULT NULL,
  `number1` decimal(12,2) DEFAULT NULL COMMENT 'Optional value for expansion',
  `number2` decimal(12,2) DEFAULT NULL COMMENT 'Optional value for expansion',
  `number3` decimal(12,2) DEFAULT NULL,
  `number4` decimal(12,2) DEFAULT NULL,
  `number5` decimal(12,2) DEFAULT NULL,
  `number6` decimal(12,2) DEFAULT NULL,
  `int1` int(11) DEFAULT NULL,
  `int2` int(11) DEFAULT NULL,
  `flag1` tinyint(1) unsigned DEFAULT '0',
  `flag2` tinyint(1) unsigned DEFAULT '0',
  `prevent_listing` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3936 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_order`
--

DROP TABLE IF EXISTS `bfcms_order`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `cart` int(10) unsigned DEFAULT NULL,
  `billing` int(10) unsigned DEFAULT NULL,
  `shipping` int(10) unsigned DEFAULT NULL,
  `username` varchar(128) DEFAULT NULL,
  `currency` varchar(3) NOT NULL DEFAULT 'cad',
  `amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `processing_fees_added` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `total` decimal(10,2) NOT NULL DEFAULT '0.00',
  `payment_gateway` varchar(32) NOT NULL,
  `payment_response` text,
  `card_brand` varchar(10) DEFAULT NULL,
  `card_last4` varchar(4) DEFAULT NULL,
  `card_expiry` date DEFAULT NULL,
  `notes` text,
  `in_memory_of` varchar(128) DEFAULT NULL,
  `date_submitted` datetime NOT NULL,
  `date_verified` datetime DEFAULT NULL,
  `is_guest` tinyint(1) NOT NULL DEFAULT '0',
  `is_verified` tinyint(1) NOT NULL DEFAULT '0',
  `is_recurring` tinyint(1) NOT NULL DEFAULT '0',
  `is_anonymous` tinyint(1) NOT NULL DEFAULT '0',
  `has_fees_added` tinyint(1) NOT NULL DEFAULT '0',
  `e_char1` varchar(128) DEFAULT NULL,
  `e_char2` varchar(128) DEFAULT NULL,
  `e_char3` varchar(128) DEFAULT NULL,
  `e_int1` int(11) DEFAULT NULL,
  `e_int2` int(11) DEFAULT NULL,
  `e_dec1` decimal(10,2) DEFAULT NULL,
  `e_dec2` decimal(10,2) DEFAULT NULL,
  `e_date1` datetime DEFAULT NULL,
  `e_date2` datetime DEFAULT NULL,
  `e_flag1` tinyint(1) NOT NULL DEFAULT '0',
  `e_flag2` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `bf_dn_expiry` (`card_expiry`),
  KEY `bf_ord_user_idx` (`username`),
  KEY `bf_ord_cart_idx` (`cart`),
  CONSTRAINT `bf_ord_cart` FOREIGN KEY (`cart`) REFERENCES `bfcms_cart` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_order_breakdown`
--

DROP TABLE IF EXISTS `bfcms_order_breakdown`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_order_breakdown` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `order` int(10) unsigned NOT NULL,
  `amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `quantity` int(10) unsigned NOT NULL DEFAULT '1',
  `is_recurring` tinyint(1) NOT NULL DEFAULT '0',
  `recurring_period` varchar(32) DEFAULT NULL,
  `recurring_start` date DEFAULT NULL,
  `product_sku` varchar(32) DEFAULT NULL,
  `campaign` varchar(64) DEFAULT NULL,
  `appeal` varchar(64) DEFAULT NULL,
  `motcode` varchar(64) DEFAULT NULL,
  `e_char1` varchar(64) DEFAULT NULL,
  `e_char2` varchar(64) DEFAULT NULL,
  `e_int1` int(11) DEFAULT NULL,
  `e_int2` int(11) DEFAULT NULL,
  `e_dec1` decimal(10,2) DEFAULT NULL,
  `e_dec2` decimal(10,2) DEFAULT NULL,
  `e_flag1` tinyint(1) NOT NULL DEFAULT '0',
  `e_flag2` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `bf_dnb_campaign` (`campaign`),
  KEY `bf_dnb_appeal` (`appeal`),
  KEY `bf_dnb_motcode` (`motcode`),
  KEY `bf_ob_order_idx` (`order`),
  CONSTRAINT `bf_ob_order` FOREIGN KEY (`order`) REFERENCES `bfcms_order` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_page`
--

DROP TABLE IF EXISTS `bfcms_page`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_page` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `lang` varchar(16) NOT NULL DEFAULT 'en',
  `module` varchar(32) NOT NULL DEFAULT 'default',
  `controller` varchar(64) NOT NULL,
  `action` varchar(64) NOT NULL,
  `name` varchar(64) DEFAULT NULL,
  `acl_resource` varchar(32) DEFAULT NULL,
  `modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` varchar(32) DEFAULT NULL,
  `layout` varchar(32) DEFAULT NULL,
  `params` longtext,
  `enabled` tinyint(1) DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `lang_key` (`lang`),
  KEY `layout_fk` (`layout`),
  KEY `page_key` (`module`,`controller`,`action`),
  KEY `bf_p_acl_resource` (`acl_resource`),
  CONSTRAINT `bf_p_acl_resource` FOREIGN KEY (`acl_resource`) REFERENCES `bfcms_acl_resources` (`name`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=1099 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_page_cell`
--

DROP TABLE IF EXISTS `bfcms_page_cell`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_page_cell` (
  `page` int(11) NOT NULL,
  `cell` int(11) NOT NULL,
  `target` varchar(16) DEFAULT 'default',
  `style` varchar(32) DEFAULT NULL,
  `template` varchar(32) DEFAULT NULL,
  `sort_order` int(11) DEFAULT '0',
  `modified_by` varchar(32) DEFAULT 'system',
  `modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`page`,`cell`),
  KEY `pc_cellfk` (`cell`),
  CONSTRAINT `pc_cellfk` FOREIGN KEY (`cell`) REFERENCES `bfcms_cell` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `pc_pagefk` FOREIGN KEY (`page`) REFERENCES `bfcms_page` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_page_cell_exclusions`
--

DROP TABLE IF EXISTS `bfcms_page_cell_exclusions`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_page_cell_exclusions` (
  `page` int(11) NOT NULL,
  `cell` int(11) NOT NULL,
  PRIMARY KEY (`page`,`cell`),
  KEY `pce_cell` (`cell`),
  CONSTRAINT `pce_cell` FOREIGN KEY (`cell`) REFERENCES `bfcms_cell` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `pce_page` FOREIGN KEY (`page`) REFERENCES `bfcms_page` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Temporary table structure for view `bfcms_page_cell_view`
--

DROP TABLE IF EXISTS `bfcms_page_cell_view`;
/*!50001 DROP VIEW IF EXISTS `bfcms_page_cell_view`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `bfcms_page_cell_view` (
  `cell` tinyint NOT NULL,
  `preferred_template` tinyint NOT NULL,
  `preferred_style` tinyint NOT NULL,
  `page` tinyint NOT NULL,
  `target` tinyint NOT NULL,
  `sort_order` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `bfcms_page_header`
--

DROP TABLE IF EXISTS `bfcms_page_header`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_page_header` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `page` int(11) NOT NULL,
  `tag` varchar(16) DEFAULT NULL,
  `type` varchar(16) DEFAULT NULL,
  `content` text,
  `modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `page_header_fk` (`page`),
  CONSTRAINT `page_header_fk` FOREIGN KEY (`page`) REFERENCES `bfcms_page` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_page_navigation`
--

DROP TABLE IF EXISTS `bfcms_page_navigation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_page_navigation` (
  `page` int(11) NOT NULL,
  `cell` int(11) NOT NULL,
  PRIMARY KEY (`cell`,`page`),
  KEY `pagefk` (`page`),
  CONSTRAINT `cellfk` FOREIGN KEY (`cell`) REFERENCES `bfcms_cell` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `page_navigation_fk` FOREIGN KEY (`page`) REFERENCES `bfcms_page` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='References navigation featuretes certain pages are linked to';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_page_registry`
--

DROP TABLE IF EXISTS `bfcms_page_registry`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_page_registry` (
  `page` int(11) NOT NULL,
  `key` varchar(32) NOT NULL,
  `value` text NOT NULL,
  `modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`page`,`key`),
  CONSTRAINT `page_registry_fk` FOREIGN KEY (`page`) REFERENCES `bfcms_page` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_page_tag`
--

DROP TABLE IF EXISTS `bfcms_page_tag`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_page_tag` (
  `page` int(11) NOT NULL,
  `tag` varchar(32) NOT NULL,
  `modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`page`,`tag`),
  KEY `pct_tagfk` (`tag`),
  CONSTRAINT `pct_pagefk` FOREIGN KEY (`page`) REFERENCES `bfcms_page` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Temporary table structure for view `bfcms_page_tag_view`
--

DROP TABLE IF EXISTS `bfcms_page_tag_view`;
/*!50001 DROP VIEW IF EXISTS `bfcms_page_tag_view`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `bfcms_page_tag_view` (
  `id` tinyint NOT NULL,
  `lang` tinyint NOT NULL,
  `module` tinyint NOT NULL,
  `controller` tinyint NOT NULL,
  `action` tinyint NOT NULL,
  `name` tinyint NOT NULL,
  `modified_on` tinyint NOT NULL,
  `modified_by` tinyint NOT NULL,
  `layout` tinyint NOT NULL,
  `enabled` tinyint NOT NULL,
  `tags` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `bfcms_phrase`
--

DROP TABLE IF EXISTS `bfcms_phrase`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_phrase` (
  `id` varchar(64) NOT NULL,
  `lang` varchar(3) NOT NULL DEFAULT 'en',
  `category` varchar(32) DEFAULT NULL,
  `type` varchar(16) DEFAULT 'default',
  `message` text,
  `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`,`lang`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_product`
--

DROP TABLE IF EXISTS `bfcms_product`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_product` (
  `id` int(11) NOT NULL,
  `sku` varchar(32) NOT NULL DEFAULT '',
  `name` varchar(64) NOT NULL,
  `display_name` varchar(128) NOT NULL,
  `teaser` varchar(128) DEFAULT NULL,
  `description` text,
  `image` varchar(255) DEFAULT NULL,
  `stock` int(11) DEFAULT NULL,
  `max_stock` int(10) unsigned DEFAULT NULL,
  `price` decimal(12,2) NOT NULL DEFAULT '0.00',
  `has_user_price` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `user_price_suggestions` text,
  `can_select_quantity` tinyint(1) DEFAULT '0',
  `can_recur` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `must_recur` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `campaign` varchar(64) DEFAULT NULL,
  `appeal` varchar(64) DEFAULT NULL,
  `motcode` varchar(64) DEFAULT NULL,
  `params` mediumtext,
  `template` varchar(32) DEFAULT NULL,
  `style` varchar(32) DEFAULT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT '1',
  `is_physical` tinyint(1) NOT NULL DEFAULT '1',
  `is_donation` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `created_on` datetime DEFAULT NULL,
  `created_by` varchar(128) DEFAULT NULL,
  `modified_on` datetime DEFAULT NULL,
  `modified_by` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `bf_prod_sku` (`sku`),
  KEY `bf_prod_price` (`price`),
  KEY `bf_prod_donation` (`is_donation`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_redirects`
--

DROP TABLE IF EXISTS `bfcms_redirects`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_redirects` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `url` varchar(255) NOT NULL,
  `redirect_to` varchar(255) NOT NULL,
  `redirect_code` smallint(3) NOT NULL DEFAULT '301',
  `is_internal` tinyint(1) NOT NULL DEFAULT '0',
  `enabled` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `created_by` varchar(128) DEFAULT NULL,
  `created_on` datetime DEFAULT NULL,
  `modified_by` varchar(128) DEFAULT NULL,
  `modified_on` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `bf_redirect_url` (`url`)
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_registry`
--

DROP TABLE IF EXISTS `bfcms_registry`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_registry` (
  `category` varchar(32) NOT NULL DEFAULT 'global',
  `subcategory` varchar(32) NOT NULL DEFAULT '',
  `key` varchar(32) NOT NULL,
  `value` text,
  `modified_on` timestamp NULL DEFAULT NULL,
  `modified_by` varchar(128) DEFAULT NULL,
  `sort_order` smallint(6) NOT NULL DEFAULT '0',
  PRIMARY KEY (`category`,`key`,`subcategory`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_revision`
--

DROP TABLE IF EXISTS `bfcms_revision`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_revision` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `revision` smallint(6) NOT NULL DEFAULT '1',
  `published` tinyint(1) NOT NULL DEFAULT '0',
  `primary` int(10) unsigned DEFAULT NULL,
  `table` varchar(64) DEFAULT NULL,
  `root_id` int(10) unsigned DEFAULT NULL,
  `model` varchar(64) DEFAULT NULL,
  `rows` longtext,
  `created_by` varchar(128) DEFAULT NULL,
  `created_on` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14790 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_translation`
--

DROP TABLE IF EXISTS `bfcms_translation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_translation` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `language` varchar(16) NOT NULL,
  `published` tinyint(1) NOT NULL DEFAULT '0',
  `table` varchar(64) DEFAULT NULL,
  `root_id` int(10) unsigned DEFAULT NULL,
  `model` varchar(64) DEFAULT NULL,
  `rows` longtext,
  `created_by` varchar(128) DEFAULT NULL,
  `created_on` datetime NOT NULL,
  `modified_by` varchar(128) DEFAULT NULL,
  `modified_on` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_user`
--

DROP TABLE IF EXISTS `bfcms_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_user` (
  `username` varchar(128) NOT NULL DEFAULT '',
  `password` varchar(32) DEFAULT NULL,
  `password_salt` varchar(32) DEFAULT NULL,
  `details` int(10) unsigned DEFAULT NULL,
  `customer_id` varchar(64) DEFAULT NULL,
  `is_logged_in` tinyint(1) DEFAULT '0',
  `last_login_ip` varchar(16) DEFAULT NULL,
  `last_login` datetime DEFAULT NULL,
  `last_login_host` text,
  `modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_disabled` tinyint(1) DEFAULT '0',
  `disabled_reason` text,
  `notes` text,
  `created_on` datetime DEFAULT NULL,
  `created_by` varchar(128) DEFAULT NULL,
  `modified_by` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`username`),
  KEY `bfcms_user_details` (`details`),
  CONSTRAINT `bfcms_user_details` FOREIGN KEY (`details`) REFERENCES `bfcms_user_details` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_user_details`
--

DROP TABLE IF EXISTS `bfcms_user_details`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_user_details` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(16) DEFAULT NULL,
  `first_name` varchar(32) DEFAULT NULL,
  `initial` varchar(8) DEFAULT NULL,
  `last_name` varchar(32) DEFAULT NULL,
  `suffix` varchar(16) DEFAULT NULL,
  `company_name` varchar(128) DEFAULT NULL,
  `job_title` varchar(64) DEFAULT NULL,
  `address_line_1` varchar(255) DEFAULT NULL,
  `address_line_2` varchar(255) DEFAULT NULL,
  `address_line_3` varchar(255) DEFAULT NULL,
  `city` varchar(128) DEFAULT NULL,
  `country` varchar(3) DEFAULT NULL,
  `province` varchar(64) DEFAULT NULL,
  `postal_code` varchar(16) DEFAULT NULL,
  `email` varchar(128) DEFAULT NULL,
  `email_alternate` varchar(128) DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `fax` varchar(45) DEFAULT NULL,
  `mobile` varchar(45) DEFAULT NULL,
  `toll_free` varchar(45) DEFAULT NULL,
  `home_phone` varchar(45) DEFAULT NULL,
  `office_phone` varchar(45) DEFAULT NULL,
  `created_on` datetime NOT NULL,
  `created_by` varchar(128) NOT NULL DEFAULT 'system',
  `modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` varchar(128) NOT NULL DEFAULT 'system',
  `allow_email_contact` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `allow_phone_contact` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `allow_office_contact` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `allow_mail_contact` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=780 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bfcms_user_roles`
--

DROP TABLE IF EXISTS `bfcms_user_roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bfcms_user_roles` (
  `username` varchar(128) NOT NULL DEFAULT '',
  `role` varchar(32) NOT NULL,
  `modified_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified_by` varchar(32) DEFAULT 'system',
  PRIMARY KEY (`username`,`role`),
  KEY `rolefk` (`role`),
  CONSTRAINT `rolefk` FOREIGN KEY (`role`) REFERENCES `bfcms_acl_roles` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ur_user` FOREIGN KEY (`username`) REFERENCES `bfcms_user` (`username`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Final view structure for view `bfcms_page_cell_view`
--

/*!50001 DROP TABLE IF EXISTS `bfcms_page_cell_view`*/;
/*!50001 DROP VIEW IF EXISTS `bfcms_page_cell_view`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = utf8 */;
/*!50001 SET character_set_results     = utf8 */;
/*!50001 SET collation_connection      = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50001 VIEW `bfcms_page_cell_view` AS select `a`.`cell` AS `cell`,`a`.`preferred_template` AS `preferred_template`,`a`.`preferred_style` AS `preferred_style`,`b`.`id` AS `page`,ifnull(`d`.`target`,`a`.`preferred_target`) AS `target`,ifnull(`d`.`sort_order`,`a`.`preferred_sort_order`) AS `sort_order` from (((`bfcms_cell_placement` `a` join `bfcms_page_tag_view` `b` on(((`a`.`all` = 1) or (`b`.`id` = `a`.`page`) or (locate(`a`.`tag`,convert(`b`.`tags` using utf8)) > 0)))) left join `bfcms_page_cell_exclusions` `c` on(((`c`.`cell` = `a`.`cell`) and (`c`.`page` = `b`.`id`)))) left join `bfcms_page_cell` `d` on(((`d`.`page` = `b`.`id`) and (`d`.`cell` = `a`.`cell`)))) where ((isnull(`c`.`cell`) or (`a`.`page` is not null)) and (`a`.`enabled` = 1)) order by `a`.`preferred_target`,`a`.`preferred_sort_order` */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;

--
-- Final view structure for view `bfcms_page_tag_view`
--

/*!50001 DROP TABLE IF EXISTS `bfcms_page_tag_view`*/;
/*!50001 DROP VIEW IF EXISTS `bfcms_page_tag_view`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = utf8 */;
/*!50001 SET character_set_results     = utf8 */;
/*!50001 SET collation_connection      = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50001 VIEW `bfcms_page_tag_view` AS (select `a`.`id` AS `id`,`a`.`lang` AS `lang`,`a`.`module` AS `module`,`a`.`controller` AS `controller`,`a`.`action` AS `action`,`a`.`name` AS `name`,`a`.`modified_on` AS `modified_on`,`a`.`modified_by` AS `modified_by`,`a`.`layout` AS `layout`,`a`.`enabled` AS `enabled`,group_concat(`b`.`tag` order by `b`.`tag` ASC separator ' ') AS `tags` from (`bfcms_page` `a` left join `bfcms_page_tag` `b` on((`b`.`page` = `a`.`id`))) group by `a`.`id`) */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2017-01-05 15:25:18
