-- MySQL dump 10.13  Distrib 5.7.24, for Linux (x86_64)
--
-- Host: rds    Database: ql_billfree
-- ------------------------------------------------------
-- Server version	5.7.17-log

/*!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 `bf_alt_feedback`
--

DROP TABLE IF EXISTS `bf_alt_feedback`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_alt_feedback` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `merchant_id` int(11) NOT NULL,
  `fb_type` varchar(50) NOT NULL,
  `title` text,
  `low_rating_title` varchar(2048) DEFAULT NULL,
  `mid_rating_title` varchar(2048) DEFAULT NULL,
  `high_rating_title` varchar(2048) DEFAULT NULL,
  `status` enum('a','i') NOT NULL DEFAULT 'a',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_app_version`
--

DROP TABLE IF EXISTS `bf_app_version`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_app_version` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `version` varchar(255) NOT NULL,
  `type` varchar(50) NOT NULL,
  `os` enum('android','ios') NOT NULL DEFAULT 'android',
  `date_updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `status` enum('a','i') NOT NULL DEFAULT 'a',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='This table will be used to implement mandatory update feat.';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_bill_merchantmapping`
--

DROP TABLE IF EXISTS `bf_bill_merchantmapping`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_bill_merchantmapping` (
  `id` int(11) NOT NULL,
  `bill_id` int(11) NOT NULL,
  `merchant_id` int(11) NOT NULL,
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL,
  `added_by` int(11) NOT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `status` enum('a','i') NOT NULL DEFAULT 'i',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Maps bill uploaded by user and the merchants. ';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_bills`
--

DROP TABLE IF EXISTS `bf_bills`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_bills` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `merchant_id` varchar(2048) NOT NULL,
  `category_id` varchar(255) DEFAULT NULL,
  `bill_amount` varchar(255) DEFAULT NULL,
  `bill_date` datetime NOT NULL,
  `bill_type` varchar(255) DEFAULT 'app',
  `starred` tinyint(1) NOT NULL DEFAULT '0',
  `title` mediumtext,
  `description` longtext,
  `bill_sender` varchar(255) DEFAULT 'self-uploaded',
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL,
  `added_by` int(11) NOT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `is_deleted` enum('y','n') NOT NULL DEFAULT 'n',
  `upload_file` varchar(2048) DEFAULT NULL,
  `vou_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=81215 DEFAULT CHARSET=utf8 COMMENT='table containing records of all the bills';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_bills_feedback`
--

DROP TABLE IF EXISTS `bf_bills_feedback`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_bills_feedback` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `bill_id` int(11) NOT NULL,
  `bill_type` enum('r','t') DEFAULT 'r',
  `alt_fb_id` int(11) DEFAULT NULL,
  `rating` int(11) DEFAULT NULL,
  `comment` longtext,
  `date_added` datetime DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL,
  `flagged` enum('y','n') NOT NULL DEFAULT 'n',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1126 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_campaign`
--

DROP TABLE IF EXISTS `bf_campaign`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_campaign` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `merchant_id` int(11) NOT NULL,
  `offer_id` int(11) DEFAULT NULL,
  `start_date` datetime NOT NULL,
  `validity_date` datetime NOT NULL,
  `sms_text` longtext,
  `status` enum('a','i') DEFAULT 'a',
  `user_count` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `merchant_id` (`merchant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=200 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_campaign_storemapping`
--

DROP TABLE IF EXISTS `bf_campaign_storemapping`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_campaign_storemapping` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `campaign_id` int(11) DEFAULT NULL,
  `store_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=198 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_cart`
--

DROP TABLE IF EXISTS `bf_cart`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_cart` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `particulars` longtext,
  `qty` varchar(255) DEFAULT NULL,
  `mrp` varchar(50) NOT NULL DEFAULT '0',
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL,
  `added_by` int(11) NOT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `is_processed` enum('y','n') DEFAULT 'n',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='Table containing records of items to be added to a user cart';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_cart_ordermapping`
--

DROP TABLE IF EXISTS `bf_cart_ordermapping`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_cart_ordermapping` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cart_id` int(11) NOT NULL,
  `order_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_cart_orders`
--

DROP TABLE IF EXISTS `bf_cart_orders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_cart_orders` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `order_slug` varchar(50) DEFAULT NULL,
  `order_amount` varchar(50) DEFAULT NULL,
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL,
  `order_status` enum('a','i','p','f') NOT NULL DEFAULT 'a',
  `txn_response` longtext,
  PRIMARY KEY (`id`),
  UNIQUE KEY `order_slug` (`order_slug`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COMMENT='table for order and txn response, etc.';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_city`
--

DROP TABLE IF EXISTS `bf_city`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_city` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `city_name` varchar(255) NOT NULL,
  `state_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=639 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_conflicts`
--

DROP TABLE IF EXISTS `bf_conflicts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_conflicts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(255) DEFAULT NULL,
  `user_1` int(11) DEFAULT NULL,
  `user_2` int(11) DEFAULT NULL,
  `culprit` int(11) DEFAULT NULL,
  `is_resolved` enum('y','n') NOT NULL DEFAULT 'n',
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL,
  `status` enum('a','i') NOT NULL DEFAULT 'a',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_content_repository`
--

DROP TABLE IF EXISTS `bf_content_repository`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_content_repository` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `content_id` int(11) NOT NULL,
  `content_type` varchar(255) DEFAULT NULL,
  `file_name` varchar(255) NOT NULL,
  `unique_name` varchar(255) NOT NULL,
  `slug` varchar(255) DEFAULT NULL,
  `file_extension` varchar(255) NOT NULL,
  `mime_type` varchar(2048) DEFAULT NULL,
  `info_type` varchar(255) DEFAULT NULL,
  `description` longtext,
  `file_path` longtext NOT NULL,
  `upload_status` enum('y','n') DEFAULT 'n',
  `size` int(11) NOT NULL COMMENT 'Size in bytes go here',
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL,
  `processed` enum('y','n') DEFAULT 'n',
  `in_use` enum('y','n') DEFAULT 'y',
  `num_images` int(11) DEFAULT NULL,
  `is_deleted` enum('y','n') DEFAULT 'n',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_name` (`unique_name`)
) ENGINE=InnoDB AUTO_INCREMENT=80681 DEFAULT CHARSET=utf8 COMMENT='Repository table that contains file info and S3 path, etc.';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_corporate_mfilter`
--

DROP TABLE IF EXISTS `bf_corporate_mfilter`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_corporate_mfilter` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `merchant_id` int(11) NOT NULL,
  `level` char(50) NOT NULL DEFAULT 'L4',
  `corporation` char(50) NOT NULL,
  `state_id` int(11) DEFAULT NULL,
  `city_id` int(11) DEFAULT NULL,
  `m_display_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `merchant_id` (`merchant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_fetch_email`
--

DROP TABLE IF EXISTS `bf_fetch_email`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_fetch_email` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `access_token` longtext,
  `refresh_token` varchar(255) DEFAULT NULL,
  `date_requested` datetime DEFAULT CURRENT_TIMESTAMP,
  `history_id` varchar(255) DEFAULT NULL,
  `status` enum('a','i','p') DEFAULT 'a',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2384 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_filters`
--

DROP TABLE IF EXISTS `bf_filters`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_filters` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `filter_name` varchar(255) DEFAULT NULL,
  `remarks` varchar(2048) DEFAULT NULL,
  `date_added` datetime DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `added_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `status` enum('a','i') NOT NULL DEFAULT 'a',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_mail_queue`
--

DROP TABLE IF EXISTS `bf_mail_queue`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_mail_queue` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `from_email` varchar(2048) DEFAULT NULL,
  `to_email` longtext,
  `reply_to` varchar(1024) DEFAULT NULL,
  `subject` varchar(2048) DEFAULT NULL,
  `message` longtext,
  `attach_file_path` varchar(2048) DEFAULT NULL,
  `attach_file_name` varchar(2048) DEFAULT NULL,
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL,
  `status` enum('a','i','e') NOT NULL DEFAULT 'a',
  `response` varchar(2048) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3990 DEFAULT CHARSET=utf8 COMMENT='table ';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_merchant_filtermapping`
--

DROP TABLE IF EXISTS `bf_merchant_filtermapping`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_merchant_filtermapping` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `merchant_id` int(11) NOT NULL,
  `filter_id` int(11) NOT NULL,
  `parent_id` int(11) NOT NULL DEFAULT '0',
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `added_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `status` enum('a','i') NOT NULL DEFAULT 'a',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=utf8 COMMENT='This table will contain info for the hierarchy to be made';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_merchant_offers`
--

DROP TABLE IF EXISTS `bf_merchant_offers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_merchant_offers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(2048) DEFAULT NULL,
  `description` mediumtext NOT NULL,
  `link` varchar(2048) DEFAULT NULL,
  `start_date` datetime DEFAULT CURRENT_TIMESTAMP,
  `validity_date` datetime DEFAULT NULL,
  `discount` varchar(2048) DEFAULT NULL,
  `cats_text` text,
  `merchant_id` int(11) NOT NULL,
  `upload_file` varchar(2048) DEFAULT NULL,
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL,
  `added_by` int(11) NOT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `status` enum('a','i') NOT NULL DEFAULT 'a',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=485 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_merchant_parent_child`
--

DROP TABLE IF EXISTS `bf_merchant_parent_child`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_merchant_parent_child` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `parent_id` int(11) NOT NULL,
  `child_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_merchantinfo`
--

DROP TABLE IF EXISTS `bf_merchantinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_merchantinfo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `merchant_name` varchar(2048) DEFAULT NULL,
  `display_name` varchar(2048) DEFAULT NULL,
  `reg_no` varchar(255) DEFAULT NULL,
  `default_category` varchar(255) DEFAULT NULL,
  `address` text,
  `display_address` text,
  `display_phone` varchar(255) DEFAULT NULL,
  `state` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `pincode` int(11) NOT NULL,
  `lat` varchar(255) DEFAULT NULL,
  `lng` varchar(255) DEFAULT NULL,
  `email_bill` enum('y','n') DEFAULT 'n',
  `get_feedback` enum('y','n') DEFAULT 'n',
  `system_used` varchar(255) DEFAULT NULL,
  `has_multi_companies` enum('y','n') DEFAULT 'n',
  `comp_name_keyword` varchar(255) DEFAULT NULL,
  `upload_file` longtext,
  `upload_bg_file` longtext,
  `bill_resend_time_mins` int(11) NOT NULL DEFAULT '0',
  `date_added` datetime NOT NULL,
  `date_updated` datetime DEFAULT NULL,
  `added_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `is_deleted` enum('y','n') DEFAULT 'n',
  `needs_bg` enum('y','n') DEFAULT 'n',
  `x_disp` varchar(50) DEFAULT NULL,
  `y_disp` varchar(50) DEFAULT NULL,
  `zoom` varchar(50) DEFAULT NULL,
  `status` enum('a','i','p') NOT NULL DEFAULT 'i',
  `credit_balance` int(11) DEFAULT '0',
  `sms_credit_balance` int(11) DEFAULT '0',
  `sms_sender_id` varchar(50) DEFAULT 'BILLFR',
  `custom_sender_flag` enum('y','n') DEFAULT 'n',
  `purpose_text` varchar(255) DEFAULT NULL,
  `hide_popup` enum('y','n') DEFAULT 'n',
  `alt_popups` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=772 DEFAULT CHARSET=utf8 COMMENT='Details of merchant';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_newsletter_subscribe`
--

DROP TABLE IF EXISTS `bf_newsletter_subscribe`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_newsletter_subscribe` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `email` varchar(255) DEFAULT NULL,
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_notifications`
--

DROP TABLE IF EXISTS `bf_notifications`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_notifications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `firebase_id` varchar(2048) NOT NULL,
  `os` varchar(50) DEFAULT NULL,
  `sendios` enum('y','n') DEFAULT 'n',
  `data` longtext,
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL,
  `processed` enum('y','n') NOT NULL DEFAULT 'n',
  `is_sent` enum('y','n') DEFAULT 'n',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=123643 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_offer_cards`
--

DROP TABLE IF EXISTS `bf_offer_cards`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_offer_cards` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `section_header` varchar(2048) DEFAULT NULL,
  `card_type` enum('c','m','o') DEFAULT NULL,
  `type_id` longtext,
  `template_id` int(11) DEFAULT NULL,
  `card_priority` int(11) DEFAULT NULL COMMENT 'ranking/order of display of the cards',
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL,
  `added_by` int(11) NOT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `status` enum('a','i') NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_offer_categories`
--

DROP TABLE IF EXISTS `bf_offer_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_offer_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cat_id` int(11) NOT NULL,
  `cat_name` varchar(2048) NOT NULL,
  `cat_slug` varchar(2048) DEFAULT NULL,
  `date_added` datetime DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `status` enum('a','i') DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=85 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_offer_categories_mapping`
--

DROP TABLE IF EXISTS `bf_offer_categories_mapping`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_offer_categories_mapping` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `offer_id` int(11) NOT NULL,
  `cat_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=57969 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_offer_sorting`
--

DROP TABLE IF EXISTS `bf_offer_sorting`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_offer_sorting` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `bf_oid` varchar(2048) DEFAULT NULL,
  `is_accepted` enum('y','n') NOT NULL,
  `processed_on` datetime NOT NULL,
  `updated_on` datetime NOT NULL,
  `processed_by` int(11) NOT NULL,
  `updated_by` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_offer_stores`
--

DROP TABLE IF EXISTS `bf_offer_stores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_offer_stores` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `store_id` varchar(20) NOT NULL,
  `store_name` varchar(255) DEFAULT NULL,
  `store_link` varchar(2048) DEFAULT NULL,
  `store_cat` varchar(255) DEFAULT NULL,
  `coupon_count` int(11) DEFAULT NULL,
  `store_logo` varchar(2048) DEFAULT NULL,
  `date_added` datetime NOT NULL,
  `date_updated` datetime DEFAULT NULL,
  `status` enum('a','i') NOT NULL DEFAULT 'a',
  `processed` enum('y','n') NOT NULL DEFAULT 'n',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=179 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_offers`
--

DROP TABLE IF EXISTS `bf_offers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_offers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cm_cid` bigint(20) NOT NULL,
  `title` mediumtext,
  `description` longtext,
  `coupon` varchar(255) DEFAULT NULL,
  `type` varchar(255) NOT NULL,
  `aff_link` mediumtext,
  `validity_unix` varchar(255) DEFAULT NULL,
  `validity_date` varchar(50) DEFAULT NULL,
  `discount` varchar(255) DEFAULT NULL,
  `store_id` int(11) DEFAULT NULL,
  `user_phone` varchar(50) DEFAULT NULL,
  `store_name` varchar(255) DEFAULT NULL,
  `offer_display_type` int(11) DEFAULT NULL,
  `processed` enum('y','n') DEFAULT 'n',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=23717 DEFAULT CHARSET=utf8 COMMENT='table containing records of all the bills';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_otp`
--

DROP TABLE IF EXISTS `bf_otp`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_otp` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `user_email` varchar(255) DEFAULT NULL,
  `user_phone` varchar(50) DEFAULT NULL,
  `otp` varchar(50) NOT NULL,
  `token` varchar(255) NOT NULL,
  `purpose` varchar(255) DEFAULT NULL,
  `data` varchar(2048) DEFAULT NULL,
  `otp_type` enum('phone','email') DEFAULT NULL,
  `is_verified` enum('y','n') DEFAULT 'n',
  `attempt_count` int(50) NOT NULL DEFAULT '0',
  `expiry_time` datetime DEFAULT NULL,
  `is_sent` enum('y','n') NOT NULL,
  `date_added` datetime DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `status` enum('a','i') DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `token` (`token`)
) ENGINE=InnoDB AUTO_INCREMENT=8559 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_paymentinfo`
--

DROP TABLE IF EXISTS `bf_paymentinfo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_paymentinfo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `merchant_id` int(11) NOT NULL,
  `amount` varchar(50) DEFAULT NULL,
  `payment_date` date NOT NULL,
  `validity_date` date DEFAULT NULL,
  `remarks` longtext,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=298 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_sms_credits`
--

DROP TABLE IF EXISTS `bf_sms_credits`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_sms_credits` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `merchant_id` int(11) NOT NULL,
  `credits` int(11) NOT NULL DEFAULT '0',
  `amount` int(11) NOT NULL DEFAULT '0',
  `payment_mode` enum('gateway','cash','cheque','neft') DEFAULT NULL,
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL,
  `added_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `remarks` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=502 DEFAULT CHARSET=utf8 COMMENT='table containing records of sms credits made to merchants';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_sms_queue`
--

DROP TABLE IF EXISTS `bf_sms_queue`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_sms_queue` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sender_id` varchar(50) DEFAULT 'BILLFR',
  `user_phones` longtext NOT NULL,
  `sms_text` varchar(4096) NOT NULL,
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime DEFAULT NULL,
  `response` text,
  `status` enum('a','i','e') NOT NULL DEFAULT 'i',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=506 DEFAULT CHARSET=utf8 COMMENT='This table will handle sms queues for offer/promos';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_state`
--

DROP TABLE IF EXISTS `bf_state`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_state` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `state_name` varchar(255) NOT NULL,
  `state_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_stats`
--

DROP TABLE IF EXISTS `bf_stats`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_stats` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `auth_token` varchar(255) DEFAULT NULL,
  `user_identifier` varchar(255) DEFAULT NULL,
  `module` varchar(255) DEFAULT NULL,
  `activity` varchar(255) DEFAULT NULL,
  `content_id` varchar(255) DEFAULT NULL,
  `mode` varchar(50) DEFAULT NULL,
  `ip_address` varchar(50) DEFAULT NULL,
  `location` varchar(2048) DEFAULT NULL,
  `city` varchar(2048) DEFAULT NULL,
  `user_agent` text,
  `access_via` enum('web','mobile') DEFAULT NULL,
  `data` longtext,
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `status` enum('a','i') NOT NULL DEFAULT 'a',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=271404 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_storename`
--

DROP TABLE IF EXISTS `bf_storename`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_storename` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `store_name` varchar(2048) NOT NULL,
  `status` enum('a','i') NOT NULL DEFAULT 'a',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_temp_bills`
--

DROP TABLE IF EXISTS `bf_temp_bills`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_temp_bills` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_email` varchar(255) DEFAULT NULL,
  `user_phone` varchar(50) DEFAULT NULL,
  `post_data` longtext NOT NULL,
  `file_name` varchar(2048) DEFAULT NULL,
  `slug` varchar(255) DEFAULT NULL,
  `status` enum('a','i') NOT NULL DEFAULT 'a',
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `processed` enum('y','n') NOT NULL DEFAULT 'n',
  `sms_resent` enum('y','n') DEFAULT 'n',
  `date_updated` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=395704 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_tokens`
--

DROP TABLE IF EXISTS `bf_tokens`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_tokens` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `dev_token` varchar(2048) NOT NULL,
  `dev_info` varchar(255) NOT NULL,
  `auth_token` varchar(255) NOT NULL,
  `os` varchar(255) DEFAULT NULL,
  `user_type` varchar(50) DEFAULT 'user',
  `date_added` datetime DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `status` enum('a','i') NOT NULL DEFAULT 'i',
  PRIMARY KEY (`id`),
  UNIQUE KEY `auth_token` (`auth_token`)
) ENGINE=InnoDB AUTO_INCREMENT=11953 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_users`
--

DROP TABLE IF EXISTS `bf_users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_users` (
  `id` int(12) NOT NULL AUTO_INCREMENT,
  `user_fname` varchar(50) NOT NULL,
  `user_lname` varchar(50) DEFAULT NULL,
  `user_email` varchar(255) DEFAULT NULL,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) DEFAULT NULL,
  `token` varchar(255) DEFAULT NULL,
  `user_phone` varchar(50) NOT NULL,
  `user_summary` text,
  `user_profile_image` varchar(255) DEFAULT NULL,
  `user_last_login` datetime DEFAULT NULL,
  `admin_access` varchar(2048) DEFAULT NULL,
  `feature_access` varchar(2048) DEFAULT NULL,
  `gen_bill_access` varchar(2048) DEFAULT NULL,
  `user_email_verified` enum('y','n','e','c') NOT NULL DEFAULT 'n',
  `user_phone_verified` enum('y','n') NOT NULL DEFAULT 'n',
  `is_merchant` enum('y','n') DEFAULT 'n',
  `allow_merchant_app` enum('y','n') DEFAULT 'n',
  `date_added` datetime DEFAULT NULL,
  `date_updated` datetime DEFAULT NULL,
  `added_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `is_deleted` enum('y','n') DEFAULT 'n',
  `status` enum('a','i') NOT NULL DEFAULT 'a',
  `bulk_csv_file` longtext,
  `is_active` enum('y','n') DEFAULT 'n',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`),
  UNIQUE KEY `user_phone` (`user_phone`),
  UNIQUE KEY `user_email` (`user_email`)
) ENGINE=InnoDB AUTO_INCREMENT=5944 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_voucher_payment`
--

DROP TABLE IF EXISTS `bf_voucher_payment`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_voucher_payment` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vou_id` int(11) DEFAULT NULL,
  `mode` enum('cash','cheque','neft','credit','finance') DEFAULT 'cash',
  `amount` varchar(255) NOT NULL,
  `amt_words` varchar(255) DEFAULT NULL,
  `chq_no` varchar(255) DEFAULT NULL,
  `chq_bank` varchar(255) DEFAULT NULL,
  `wire_ref_no` varchar(255) DEFAULT NULL,
  `fin_company_name` varchar(255) DEFAULT NULL,
  `fin_loan_no` varchar(255) DEFAULT NULL,
  `fin_amt` varchar(255) DEFAULT NULL,
  `fin_paid_amt` varchar(255) DEFAULT NULL,
  `paid_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10352 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_vouchers`
--

DROP TABLE IF EXISTS `bf_vouchers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_vouchers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `merchant_id` int(11) NOT NULL,
  `party_merchant_id` int(11) DEFAULT NULL,
  `party_name` varchar(255) DEFAULT NULL,
  `party_mobile` varchar(255) DEFAULT NULL,
  `party_gst` varchar(255) DEFAULT NULL,
  `party_addr` varchar(255) DEFAULT NULL,
  `party_state` int(11) DEFAULT NULL,
  `party_email` varchar(255) DEFAULT NULL,
  `ewb_no` varchar(50) DEFAULT NULL,
  `ewb_mode` varchar(255) DEFAULT NULL,
  `ewb_veh_no` varchar(50) DEFAULT NULL,
  `ewb_supply_date` datetime DEFAULT NULL,
  `ewb_supply_place` varchar(255) DEFAULT NULL,
  `vou_prefix` varchar(50) DEFAULT NULL,
  `vou_no` int(11) DEFAULT NULL,
  `vou_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `vou_type` enum('pi','ti','rcpt','inv') DEFAULT NULL,
  `narration` text,
  `narration_flag` enum('y','n') DEFAULT 'n',
  `date_added` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `status` enum('a','i') DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9405 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_vouchers_extra`
--

DROP TABLE IF EXISTS `bf_vouchers_extra`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_vouchers_extra` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `merchant_id` int(11) DEFAULT NULL,
  `text` longtext,
  `paper_size` varchar(2048) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1969 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `bf_vouchers_particulars`
--

DROP TABLE IF EXISTS `bf_vouchers_particulars`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bf_vouchers_particulars` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `vou_id` int(11) NOT NULL,
  `particulars` longtext NOT NULL,
  `hsn` varchar(255) DEFAULT NULL,
  `gst` varchar(255) DEFAULT '0',
  `rate` varchar(255) DEFAULT '0',
  `qty` varchar(255) DEFAULT '0',
  `dis_type` enum('percent','rupee') DEFAULT 'percent',
  `dis_value` varchar(255) DEFAULT NULL,
  `total` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15406 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!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 2018-11-29 18:24:14
