


-- --------------------------------------------------------

--
-- Table structure for table `answer_subscribers`
--

CREATE TABLE IF NOT EXISTS `answer_subscribers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `answer_id` int(11) NOT NULL,
  `question_id` int(11) NOT NULL,
  `contact_id` int(11) NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`contact_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `birthdays`
--

CREATE TABLE IF NOT EXISTS `birthdays` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `group_id` int(11) NOT NULL,
  `name` varchar(250) NOT NULL,
  `message` varchar(250) NOT NULL,
  `systemmsg` varchar(255) NOT NULL,
  `days` int(11) NOT NULL,
  `sent` int(11) NOT NULL COMMENT '0=No,1=Yes',
  `sms_type` int(11) NOT NULL COMMENT '0=>sms , 1=>mms',
  `image_url` text NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `contacts`
--

CREATE TABLE IF NOT EXISTS `contacts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `birthday` date NOT NULL,
  `countrycodetel` varchar(15) NOT NULL,
  `phone_number` varchar(15) NOT NULL,
  `faxcountrycodetel` varchar(15) NOT NULL,
  `fax_number` varchar(15) NOT NULL,
  `created` datetime NOT NULL,
  `carrier` varchar(50) NOT NULL,
  `location` varchar(50) NOT NULL,
  `phone_country` varchar(50) NOT NULL,
  `line_type` varchar(20) DEFAULT NULL,
  `favorite` tinyint(4) NOT NULL DEFAULT '0',
  `un_subscribers` tinyint(4) NOT NULL DEFAULT '0',
  `color` varchar(20) NOT NULL,
  `lastmsg` datetime NOT NULL,
  `stickysender` varchar(20) NOT NULL DEFAULT '0',
  `state` varchar(25) NOT NULL,
  `zip` varchar(25) NOT NULL,
  `custom1` varchar(100) NOT NULL,
  `custom2` varchar(100) NOT NULL,
  `custom3` varchar(100) NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`email`),
  INDEX(`phone_number`),
  INDEX(`stickysender`),
  INDEX(`location`),
  INDEX(`state`),
  INDEX(`zip`),
  INDEX(`location`,`state`,`zip`),
  FULLTEXT(`name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `contact_groups`
--

CREATE TABLE IF NOT EXISTS `contact_groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `contact_id` int(11) NOT NULL,
  `group_id` int(11) NOT NULL,
  `question_id` int(11) NOT NULL,
  `contest_id` int(11) NOT NULL,
  `group_subscribers` varchar(250) NOT NULL,
  `un_subscribers` int(11) NOT NULL,
  `do_not_call` int(11) NOT NULL,
  `subscribed_by_sms` int(11) NOT NULL COMMENT '0=csv,1=sms,2=widget,3=kiosk',
  `active` int(11) NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`contact_id`),
  INDEX(`group_id`),
  INDEX(`user_id`,`subscribed_by_sms`),
  INDEX(`user_id`,`un_subscribers`,`subscribed_by_sms`),
  INDEX(`user_id`,`un_subscribers`,`created`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `contests`
--

CREATE TABLE IF NOT EXISTS `contests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `group_name` varchar(250) NOT NULL,
  `group_id` int(11) NOT NULL,
  `startdate` date NOT NULL,
  `enddate` date NOT NULL,
  `maxentries` tinyint(4) NOT NULL,
  `keyword` varchar(250) NOT NULL,
  `system_message` varchar(250) NOT NULL,
  `active` int(1) NOT NULL,
  `totalsubscriber` int(11) NOT NULL,
  `winning_phone_number` varchar(20) NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `contest_subscribers`
--

CREATE TABLE IF NOT EXISTS `contest_subscribers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `contest_id` int(11) NOT NULL,
  `phone_number` varchar(20) NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`phone_number`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `groups`
--

CREATE TABLE IF NOT EXISTS `groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `group_name` varchar(100) NOT NULL,
  `keyword` varchar(100) NOT NULL,
  `group_type` int(11) NOT NULL,
  `auto_message` varchar(100) NOT NULL,
  `system_message` varchar(130) DEFAULT NULL,
  `ifmember_message` varchar(160) NOT NULL DEFAULT 'You are already subscribed to this list',
  `sms_type` int(11) NOT NULL COMMENT '1=> sms ,2=>mms',
  `bithday_enable` int(11) NOT NULL DEFAULT '0',
  `image_url` text NOT NULL,
  `active` int(11) NOT NULL,
  `totalsubscriber` int(11) NOT NULL,
  `notify_signup` int(11) NOT NULL DEFAULT '0',
  `mobile_number_input` varchar(50) NOT NULL,
  `property_address` varchar(50) DEFAULT NULL,
  `property_price` varchar(20) DEFAULT NULL,
  `property_bed` tinyint(4) DEFAULT NULL,
  `property_bath` varchar(5) DEFAULT NULL,
  `property_description` varchar(200) DEFAULT NULL,
  `property_url` varchar(200) DEFAULT NULL,
  `vehicle_year` varchar(10) DEFAULT NULL,
  `vehicle_make` varchar(30) DEFAULT NULL,
  `vehicle_model` varchar(30) DEFAULT NULL,
  `vehicle_mileage` varchar(30) DEFAULT NULL,
  `vehicle_price` varchar(20) DEFAULT NULL,
  `vehicle_description` varchar(200) DEFAULT NULL,
  `vehicle_url` varchar(200) DEFAULT NULL,
  `double_optin` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`keyword`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `group_sms_blasts`
--

CREATE TABLE IF NOT EXISTS `group_sms_blasts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `group_id` int(11) NOT NULL,
  `totals` int(11) NOT NULL,
  `total_successful_messages` int(11) NOT NULL,
  `total_failed_messages` int(11) NOT NULL,
  `isdeleted` int(11) NOT NULL,
  `responder` int(11) NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `invoices`
--

CREATE TABLE IF NOT EXISTS `invoices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `txnid` varchar(250) NOT NULL,
  `type` int(11) NOT NULL,
  `package_name` varchar(50) NOT NULL,
  `amount` float NOT NULL,
  `created` date NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;

-- --------------------------------------------------------

--
-- Table structure for table `logs`
--

CREATE TABLE IF NOT EXISTS `logs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `group_sms_id` int(11) NOT NULL DEFAULT '0',
  `sms_id` varchar(250) DEFAULT NULL,
  `ticket` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT '0',
  `group_id` int(11) DEFAULT '0',
  `contact_id` int(11) NOT NULL DEFAULT '0',
  `sendfrom` varchar(20) DEFAULT NULL,
  `phone_number` varchar(20) NOT NULL,
  `name` varchar(50) DEFAULT NULL,
  `email_to_sms_number` varchar(20) NOT NULL,
  `text_message` text,
  `image_url` text NOT NULL,
  `voice_url` varchar(500) DEFAULT NULL,
  `call_duration` varchar(15) DEFAULT NULL,
  `route` varchar(20) NOT NULL DEFAULT 'inbox',
  `msg_type` varchar(20) NOT NULL DEFAULT 'text',
  `inbox_type` tinyint(4) NOT NULL DEFAULT '1',
  `sms_status` varchar(250) NOT NULL,
  `error_message` text DEFAULT NULL,
  `read` tinyint(1) NOT NULL DEFAULT '0',
  `is_deleted` tinyint(4) NOT NULL DEFAULT '0',
  `msgsound` tinyint(4) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`group_sms_id`),
  INDEX(`sms_id`),
  INDEX(`contact_id`),
  INDEX(`ticket`),
  INDEX(`phone_number`),
  INDEX(`user_id`,`route`,`msg_type`,`created`),
  INDEX(`route`,`msg_type`,`sms_status`,`created`),
  INDEX(`user_id`,`route`,`msg_type`,`read`),
  INDEX(`created`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `mobile_pages`
--

CREATE TABLE IF NOT EXISTS `mobile_pages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `title` varchar(250) NOT NULL,
  `description` text NOT NULL,
  `header_logo` varchar(250) DEFAULT NULL,
  `header_color` varchar(250) NOT NULL,
  `headerfont_color` varchar(250) NOT NULL,
  `bodybg_color` varchar(250) NOT NULL,
  `footer_color` varchar(250) NOT NULL,
  `footertext_color` varchar(250) NOT NULL,
  `footertext` varchar(250) NOT NULL,
  `map_url` text NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `monthly_packages`
--

CREATE TABLE IF NOT EXISTS `monthly_packages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(20) NOT NULL,
  `product_id` varchar(50) NOT NULL,
  `package_name` varchar(250) NOT NULL,
  `amount` float NOT NULL,
  `text_messages_credit` varchar(20) NOT NULL,
  `voice_messages_credit` varchar(20) NOT NULL,
  `status` int(11) NOT NULL,
  `user_country` varchar(50) NOT NULL,
  `credits_carryover` tinyint(4) NOT NULL DEFAULT '1',
  `autoresponders` tinyint(4) NOT NULL DEFAULT '1',
  `importcontacts` tinyint(4) NOT NULL DEFAULT '1',
  `shortlinks` tinyint(4) NOT NULL DEFAULT '1',
  `voicebroadcast` tinyint(4) NOT NULL DEFAULT '1',
  `polls` tinyint(4) NOT NULL DEFAULT '1',
  `contests` tinyint(4) NOT NULL DEFAULT '1',
  `loyaltyprograms` tinyint(4) NOT NULL DEFAULT '1',
  `kioskbuilder` tinyint(4) NOT NULL DEFAULT '1',
  `birthdaywishes` tinyint(4) NOT NULL DEFAULT '1',
  `mobilepagebuilder` tinyint(4) NOT NULL DEFAULT '1',
  `webwidgets` tinyint(4) NOT NULL DEFAULT '1',
  `smschat` tinyint(4) NOT NULL DEFAULT '1',
  `qrcodes` tinyint(4) NOT NULL DEFAULT '1',
  `calendarscheduler` tinyint(4) NOT NULL DEFAULT '1',
  `appointments` tinyint(4) NOT NULL DEFAULT '1',
  `groups` tinyint(4) NOT NULL DEFAULT '1',
  `contactlist` tinyint(4) NOT NULL DEFAULT '1',
  `sendsms` tinyint(4) NOT NULL DEFAULT '1',
  `affiliates` tinyint(4) NOT NULL DEFAULT '1',
  `getnumbers` tinyint(4) NOT NULL DEFAULT '1',
  `qabots` tinyint(4) NOT NULL DEFAULT '1',
  `mobilecoupons` tinyint(4) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;

-- --------------------------------------------------------

--
-- Table structure for table `options`
--

CREATE TABLE IF NOT EXISTS `options` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `question_id` int(11) NOT NULL,
  `optiona` varchar(250) NOT NULL,
  `optionb` varchar(50) NOT NULL,
  `autorsponder_message` varchar(250) NOT NULL,
  `count` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `packages`
--

CREATE TABLE IF NOT EXISTS `packages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(20) NOT NULL,
  `product_id` varchar(20) NOT NULL,
  `name` varchar(255) NOT NULL,
  `amount` float NOT NULL,
  `credit` int(11) NOT NULL,
  `type` varchar(10) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `user_country` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;

-- --------------------------------------------------------

--
-- Table structure for table `paypal_items`
--

CREATE TABLE IF NOT EXISTS `paypal_items` (
  `id` varchar(36) NOT NULL,
  `instant_payment_notification_id` varchar(36) NOT NULL,
  `item_name` varchar(127) DEFAULT NULL,
  `item_number` varchar(127) DEFAULT NULL,
  `quantity` varchar(127) DEFAULT NULL,
  `mc_gross` float(10,2) DEFAULT NULL,
  `mc_shipping` float(10,2) DEFAULT NULL,
  `mc_handling` float(10,2) DEFAULT NULL,
  `tax` float(10,2) DEFAULT NULL,
  `created` datetime NOT NULL,
  `modified` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `qrcods`
--

CREATE TABLE IF NOT EXISTS `qrcods` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `name` varchar(250) NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;

-- --------------------------------------------------------

--
-- Table structure for table `questions`
--

CREATE TABLE IF NOT EXISTS `questions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `group_id` int(11) NOT NULL,
  `question` text NOT NULL,
  `active` int(11) NOT NULL,
  `autoreply_message` varchar(250) NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `referrals`
--

CREATE TABLE IF NOT EXISTS `referrals` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL COMMENT 'new_user_id',
  `referred_by` int(11) NOT NULL COMMENT 'referred_by',
  `url` varchar(255) DEFAULT NULL,
  `amount` float NOT NULL,
  `paid_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-unpaid,1-paid',
  `type` int(11) NOT NULL,
  `created` datetime NOT NULL,
  `account_activated` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  INDEX(`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `responders`
--

CREATE TABLE IF NOT EXISTS `responders` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `group_id` int(11) NOT NULL,
  `name` varchar(250) NOT NULL,
  `message` varchar(250) NOT NULL,
  `systemmsg` varchar(255) NOT NULL,
  `days` int(11) NOT NULL,
  `ishour` tinyint(4) NOT NULL DEFAULT '1',
  `sent` int(11) NOT NULL COMMENT '0=No,1=Yes',
  `sms_type` int(11) NOT NULL COMMENT '0=>sms , 1=>mms',
  `image_url` text NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `schedule_messages`
--

CREATE TABLE IF NOT EXISTS `schedule_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `recurring_id` int(11) NOT NULL DEFAULT '0',
  `message` text NOT NULL,
  `systemmsg` varchar(255) NOT NULL,
  `send_on` datetime NOT NULL,
  `sent` int(11) NOT NULL,
  `created` datetime NOT NULL,
  `rotate_number` int(11) NOT NULL,
  `msg_type` int(11) NOT NULL,
  `mms_text` text NOT NULL,
  `pick_file` varchar(200) NOT NULL,
  `throttle` int(11) NOT NULL,
  `alphasender` tinyint(4) NOT NULL,
  `alphasender_input` varchar(15) NOT NULL,
  `sendfrom` varchar(20) NOT NULL,
  `repeatmsg` tinyint(4) NOT NULL,
  `language` varchar(50) NOT NULL,
  `pause` tinyint(4) NOT NULL,
  `forward` tinyint(4) NOT NULL,
  `forwardnumber` varchar(20) NOT NULL,
  `voice_id` int(11) NOT NULL DEFAULT '0',
  `city` varchar(50) NOT NULL,
  `state` varchar(25) NOT NULL,
  `zip` varchar(25) NOT NULL,
  `stickysender` tinyint(4) NOT NULL DEFAULT '0',
  `geomatch` tinyint(4) NOT NULL DEFAULT '0',
  `tollfree` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`recurring_id`),
  INDEX(`voice_id`),
  INDEX(`msg_type`,`sent`,`send_on`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `schedule_message_groups`
--

CREATE TABLE IF NOT EXISTS `schedule_message_groups` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `schedule_sms_id` int(11) NOT NULL,
  `group_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `shortlinks`
--

CREATE TABLE IF NOT EXISTS `shortlinks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `shortname` varchar(250) NOT NULL,
  `url` varchar(250) NOT NULL,
  `short_url` varchar(250) NOT NULL,
  `clicks` int(11) NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `single_schedule_messages`
--

CREATE TABLE IF NOT EXISTS `single_schedule_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `schedule_sms_id` int(11) NOT NULL,
  `contact_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;

-- --------------------------------------------------------

--
-- Table structure for table `smstemplates`
--

CREATE TABLE IF NOT EXISTS `smstemplates` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(10) NOT NULL,
  `messagename` varchar(250) NOT NULL,
  `message_template` varchar(1588) NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `user_numbers`
--

CREATE TABLE IF NOT EXISTS `user_numbers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `number` varchar(20) NOT NULL,
  `phone_sid` varchar(250) DEFAULT NULL,
  `api_type` int(11) NOT NULL,
  `country_code` varchar(255) DEFAULT NULL,
  `created` datetime NOT NULL,
  `sms` int(11) NOT NULL DEFAULT '0',
  `mms` int(11) NOT NULL DEFAULT '0',
  `voice` int(11) NOT NULL DEFAULT '0',
  `fax` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`number`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `voice_messages`
--

CREATE TABLE IF NOT EXISTS `voice_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `group_id` int(11) NOT NULL,
  `message_type` int(11) NOT NULL,
  `text_message` text NOT NULL,
  `audio` varchar(200) NOT NULL,
  `created` varchar(150) NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------
--
-- Table structure for table `smsloyalties`
--

CREATE TABLE IF NOT EXISTS `smsloyalties` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `program_name` varchar(250) NOT NULL,
  `group_id` int(11) NOT NULL,
  `startdate` date NOT NULL,
  `enddate` date NOT NULL,
  `coupancode` varchar(100) NOT NULL,
  `codestatus` varchar(100) NOT NULL,
  `reachgoal` int(11) NOT NULL,
  `addpoints` text NOT NULL,
  `reachedatgoal` text NOT NULL,
  `checkstatus` text NOT NULL,
  `type` int(11) NOT NULL DEFAULT '1' COMMENT '1=>SMS,2=>MMS',
  `image` varchar(250) DEFAULT NULL,
  `status` int(11) NOT NULL DEFAULT '1',
  `notify_punch_code` int(11) NOT NULL DEFAULT '0',
  `my_email_address` int(11) NOT NULL DEFAULT '0',
  `email_address` int(11) NOT NULL DEFAULT '0',
  `email_address_input` varchar(50) NOT NULL,
  `mobile_number` int(11) NOT NULL DEFAULT '0',
  `mobile_number_input` varchar(50) NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `smsloyalty_users`
--

CREATE TABLE IF NOT EXISTS `smsloyalty_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `unique_key` varchar(100) NOT NULL,
  `user_id` int(11) NOT NULL,
  `sms_loyalty_id` int(11) NOT NULL,
  `contact_id` int(11) NOT NULL,
  `keyword` varchar(100) NOT NULL,
  `count_trial` int(11) NOT NULL,
  `is_winner` int(11) NOT NULL,
  `redemptions` int(11) NOT NULL,
  `msg_date` date NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`contact_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


-- -------------------------------------------------------

--
-- Table structure for table `kiosks`
--

CREATE TABLE IF NOT EXISTS `kiosks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `unique_id` varchar(100) NOT NULL,
  `user_id` int(11) NOT NULL,
  `loyalty_id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `background_color` varchar(100) DEFAULT NULL,
  `style` varchar(100) DEFAULT NULL,
  `file` varchar(255) DEFAULT NULL,
  `business_logo` varchar(255) NOT NULL,
  `textheader` text NOT NULL,
  `alignment` varchar(100) DEFAULT NULL,
  `font` varchar(100) DEFAULT NULL,
  `fontsize` varchar(100) DEFAULT NULL,
  `color` varchar(100) DEFAULT NULL,
  `styleB` int(11) NOT NULL DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `styleI` int(11) NOT NULL DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `styleU` int(11) NOT NULL DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `joinbuttons` int(11) DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `punchcard` int(11) NOT NULL DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `checkpoints` int(11) NOT NULL DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `joinbutton` varchar(100) DEFAULT NULL,
  `checkin` varchar(100) DEFAULT NULL,
  `mypoints` varchar(100) DEFAULT NULL,
  `buttoncolor` varchar(100) DEFAULT NULL,
  `textcolor` varchar(100) DEFAULT NULL,
  `keypad_button_color` varchar(100) DEFAULT NULL,
  `keypad_text_color` varchar(100) DEFAULT NULL,
  `bottom_text` text,
  `bottom_text_alignment` varchar(100) DEFAULT NULL,
  `bottom_text_font` varchar(100) DEFAULT NULL,
  `bottom_text_size` varchar(100) DEFAULT NULL,
  `bottom_text_color` varchar(100) DEFAULT NULL,
  `bottom_text_styleB` int(11) NOT NULL DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `bottom_text_styleI` int(11) NOT NULL DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `bottom_text_styleU` int(11) NOT NULL DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `firstname` int(11) NOT NULL DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `lastname` int(11) NOT NULL DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `email` int(11) NOT NULL DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `dob` int(11) NOT NULL DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `city` int(11) NOT NULL DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `state` int(11) NOT NULL DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `zip` int(11) NOT NULL DEFAULT '0' COMMENT '0=>No,1=>Yes',
  `created` datetime NOT NULL COMMENT '0=>No,1=>Yes',
  PRIMARY KEY (`id`),
  INDEX(`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `monthly_number_packages`
--

CREATE TABLE IF NOT EXISTS `monthly_number_packages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(20) NOT NULL,
  `plan` varchar(50) NOT NULL,
  `package_name` varchar(250) NOT NULL,
  `amount` float NOT NULL,
  `total_secondary_numbers` int(11) NOT NULL,
  `country` varchar(50) NOT NULL,
  `status` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;

-- --------------------------------------------------------


--
-- Table structure for table `activity_timeline`
--

CREATE TABLE IF NOT EXISTS `activity_timelines` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `contact_id` int(11) NOT NULL,
  `activity` tinyint(4) NOT NULL,
  `title` varchar(50) NOT NULL,
  `description` varchar(500) NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`contact_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------


--
-- Table structure for table `appointments`
--

CREATE TABLE IF NOT EXISTS `appointments` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `contact_id` int(11) NOT NULL,
  `app_date_time` datetime NOT NULL,
  `appointment_status` tinyint(4) NOT NULL COMMENT '0=>Unconfirmed,1=>Confirmed,2=>Cancelled,3=>Rescheduled',
  `scheduled` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0=>Not Scheduled,1=>Scheduled',
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`contact_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------


--
-- Table structure for table `appointment_settings`
--

CREATE TABLE IF NOT EXISTS `appointment_settings` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `cancel_keyword` varchar(100) NOT NULL,
  `cancel_message` varchar(255) NOT NULL,
  `cancel_color_picker` varchar(50) NOT NULL,
  `cancel_email_to` varchar(100) NOT NULL,
  `cancel_email_from` varchar(100) NOT NULL,
  `cancel_email_subject` varchar(150) NOT NULL,
  `reschedule_keyword` varchar(100) NOT NULL,
  `cancel_email_body` text NOT NULL,
  `reschedule_message` varchar(255) NOT NULL,
  `reschedule_color_picker` varchar(50) NOT NULL,
  `reschedule_email_to` varchar(100) NOT NULL,
  `reschedule_email_from` varchar(100) NOT NULL,
  `reschedule_email_subject` varchar(150) NOT NULL,
  `reschedule_email_body` text NOT NULL,
  `confirm_keyword` varchar(100) NOT NULL,
  `confirm_message` varchar(255) NOT NULL,
  `confirm_color_picker` varchar(50) NOT NULL,
  `confirm_email_to` varchar(100) NOT NULL,
  `confirm_email_from` varchar(100) NOT NULL,
  `confirm_email_subject` varchar(150) NOT NULL,
  `confirm_email_body` text NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------


--
-- Table structure for table `country_gateways`
--


CREATE TABLE IF NOT EXISTS `country_gateways` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `country` varchar(50) NOT NULL,
  `api_type` varchar(2) NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`country`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

INSERT INTO `country_gateways` (`country`) VALUES ( 'Afghanistan' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Albania'  );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Algeria' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'American Samoa' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Andorra' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Angola' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Anguilla' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Antarctica' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Antigua And Barbuda' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Argentina' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Armenia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Aruba' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Australia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Austria' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Azerbaijan' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Bahamas' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Bahrain' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Bangladesh' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Barbados' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Belarus' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Belgium' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Belize' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Benin' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Bermuda' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Bhutan' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Bolivia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Bosnia And Herzegovina' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Botswana' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Bouvet Island' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Brazil' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'British Indian Ocean Territory' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Brunei Darussalam' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Bulgaria' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Burkina Faso' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Burundi' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Cambodia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Cameroon' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Canada' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Cape Verde' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Cayman Islands' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Central African Republic' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Chad' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Chile' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'China' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Christmas Island' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Cocos (keeling) Islands' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Colombia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Comoros' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Congo' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Congo, The Democratic Republic Of The' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Cook Islands' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Costa Rica' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Croatia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Cuba' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Cyprus' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Czech Republic' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Denmark' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Djibouti' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Dominica' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Dominican Republic' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'East Timor' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Ecuador' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Egypt' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'El Salvador' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Equatorial Guinea' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Eritrea' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Estonia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Ethiopia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Falkland Islands (malvinas)' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Faroe Islands' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Fiji' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Finland' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'France' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'French Guiana' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'French Polynesia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'French Southern Territories' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Gabon' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Gambia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Georgia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Germany' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Ghana' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Gibraltar' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Greece' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Greenland' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Grenada' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Guadeloupe' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Guam' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Guatemala' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Guinea' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Guinea-bissau' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Guyana' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Haiti' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Heard Island And Mcdonald Islands' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Holy See (vatican City State)' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Honduras' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Hong Kong' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Hungary' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Iceland' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'India' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Indonesia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Iran, Islamic Republic Of' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Iraq' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Ireland' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Israel' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Italy' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Jamaica' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Japan' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Jordan' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Kazakstan' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Kenya' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Kiribati' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Korea, Republic Of' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Kosovo' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Kuwait' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Kyrgyzstan' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Latvia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Lebanon' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Lesotho' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Liberia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Libyan Arab Jamahiriya' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Liechtenstein' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Lithuania' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Luxembourg' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Macau' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Macedonia, The Former Yugoslav Republic Of' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Madagascar' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Malawi' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Malaysia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Maldives' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Mali' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Malta' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Marshall Islands' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Martinique' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Mauritania' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Mauritius' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Mayotte' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Mexico' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Micronesia, Federated States Of' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Moldova, Republic Of' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Monaco' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Mongolia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Montserrat' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Montenegro' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Morocco' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Mozambique' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Myanmar' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Namibia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Nauru' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Nepal' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Netherlands' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Netherlands Antilles' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'New Caledonia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'New Zealand' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Nicaragua' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Niger' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Nigeria' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Niue' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Norfolk Island' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Northern Mariana Islands' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Norway' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Oman' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Pakistan' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Palau' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Palestinian Territory, Occupied' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Panama' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Papua New Guinea' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Paraguay' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Peru' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Philippines' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Pitcairn' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Poland' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Portugal' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Puerto Rico' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Qatar' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Reunion' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Romania' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Russian Federation' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Rwanda' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Saint Helena' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Saint Kitts And Nevis' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Saint Lucia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Saint Pierre And Miquelon' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Saint Vincent And The Grenadines' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Samoa' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'San Marino' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Sao Tome And Principe' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Saudi Arabia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Senegal' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Serbia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Seychelles' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Sierra Leone' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Singapore' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Slovakia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Slovenia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Solomon Islands' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Somalia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'South Africa' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'South Georgia And The South Sandwich Islands' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Spain' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Sri Lanka' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Sudan' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Suriname' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Svalbard And Jan Mayen' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Swaziland' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Sweden' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Switzerland' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Syrian Arab Republic' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Taiwan, Province Of China' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Tajikistan' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Tanzania, United Republic Of' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Thailand' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Togo' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Tokelau' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Tonga' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Trinidad And Tobago' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Tunisia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Turkey' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Turkmenistan' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Turks And Caicos Islands' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Tuvalu' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Uganda' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Ukraine' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'United Arab Emirates' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'United Kingdom' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'United States' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'United States Minor Outlying Islands' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Uruguay' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Uzbekistan' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Vanuatu' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Venezuela' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Viet Nam' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Virgin Islands, British' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Virgin Islands, U.s.' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Wallis And Futuna' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Western Sahara' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Yemen' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Zambia' );
INSERT INTO `country_gateways` (`country`) VALUES ( 'Zimbabwe' );


-- --------------------------------------------------------

--
-- Table structure for table `appointment_csvs`
--

CREATE TABLE IF NOT EXISTS `appointment_csvs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `phone_number` varchar(50) NOT NULL,
  `appointment_status` varchar(50) DEFAULT NULL,
  `app_date_time` datetime NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


-- --------------------------------------------------------

--
-- Table structure for table `contact_notes`
--

CREATE TABLE IF NOT EXISTS `contact_notes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `contact_id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `note` text NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`contact_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


-- --------------------------------------------------------

--
-- Table structure for table `multi_contests`
--

CREATE TABLE IF NOT EXISTS `multi_contests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `group_id` int(11) NOT NULL DEFAULT '0',
  `finish_all_questions` tinyint(4) NOT NULL DEFAULT '0',
  `name` varchar(100) NOT NULL,
  `keyword` varchar(100) NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`keyword`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


-- --------------------------------------------------------

--
-- Table structure for table `multi_contest_questions`
--

CREATE TABLE IF NOT EXISTS `multi_contest_questions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `multi_contest_id` int(11) NOT NULL,
  `question` text NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`multi_contest_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


-- --------------------------------------------------------

--
-- Table structure for table `multi_contest_questions_options`
--

CREATE TABLE IF NOT EXISTS `multi_contest_questions_options` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `multi_contest_id` int(11) NOT NULL,
  `question_id` int(11) NOT NULL,
  `answer` varchar(50) NOT NULL,
  `description` varchar(250) NOT NULL,
  `email` varchar(250) NOT NULL,
  `phone` varchar(250) NOT NULL,
  `text` text NOT NULL,
  `response` text NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`multi_contest_id`),
  INDEX(`question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


-- --------------------------------------------------------

--
-- Table structure for table `multi_contest_subscribers`
--

CREATE TABLE IF NOT EXISTS `multi_contest_subscribers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `contact_id` int(11) NOT NULL,
  `multi_contest_id` int(11) NOT NULL,
  `multi_contest_question_id` int(11) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `question` text NOT NULL,
  `total_questions` tinyint(4) NOT NULL DEFAULT '0',
  `total_answer_questions` tinyint(4) NOT NULL DEFAULT '0',
  `answer` varchar(250) NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`multi_contest_id`),
  INDEX(`multi_contest_question_id`),
  INDEX(`phone`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


-- --------------------------------------------------------

--
-- Table structure for table `multi_contest_subscriber_archives`
--

CREATE TABLE IF NOT EXISTS `multi_contest_subscriber_archives` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `contact_id` int(11) NOT NULL,
  `multi_contest_id` int(11) NOT NULL,
  `multi_contest_question_id` int(11) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `question` text NOT NULL,
  `total_questions` tinyint(4) NOT NULL DEFAULT '0',
  `total_answer_questions` tinyint(4) NOT NULL DEFAULT '0',
  `answer` varchar(250) NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`multi_contest_id`),
  INDEX(`phone`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


-- --------------------------------------------------------

--
-- Table structure for table `mobile_coupon_analytics`
--

CREATE TABLE IF NOT EXISTS `mobile_coupon_analytics` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `mobile_coupon_id` int(11) NOT NULL DEFAULT '0',
  `ip` varchar(250) DEFAULT NULL,
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  INDEX(`mobile_coupon_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


-- --------------------------------------------------------

--
-- Table structure for table `mobile_coupons`
--

CREATE TABLE IF NOT EXISTS `mobile_coupons` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `unique_id` varchar(50) NOT NULL,
  `name` varchar(100) NOT NULL,
  `description` text,
  `one_per_person` tinyint(4) NOT NULL,
  `redemption_reset` tinyint(4) NOT NULL,
  `coupon_expiration` tinyint(4) NOT NULL DEFAULT '0',
  `dynamic_days` tinyint(4) NOT NULL DEFAULT '1',
  `expiration_date` datetime NOT NULL,
  `showVoteContainer` tinyint(4) NOT NULL,
  `coupon_colorway` varchar(50) DEFAULT NULL,
  `coupon_header` varchar(100) NOT NULL,
  `offer_image` varchar(250) DEFAULT NULL,
  `offer_name` varchar(250) NOT NULL,
  `offer_description` varchar(250) NOT NULL,
  `redeem_button_text` varchar(100) DEFAULT NULL,
  `fine_print` varchar(250) NOT NULL,
  `showCallLink` tinyint(4) NOT NULL,
  `call_number` varchar(20) DEFAULT NULL,
  `showWebsiteLink` tinyint(4) NOT NULL,
  `website` varchar(250) DEFAULT NULL,
  `showFacebookLink` tinyint(4) NOT NULL,
  `facebook` varchar(250) DEFAULT NULL,
  `showInstagramLink` tinyint(4) NOT NULL,
  `instagram` varchar(250) DEFAULT NULL,
  `showDirectionsLink` tinyint(4) NOT NULL,
  `directions` varchar(300) DEFAULT NULL,
  `redemption_type` tinyint(4) NOT NULL,
  `Redemption_Action` varchar(250) DEFAULT NULL,
  `redemption_code` varchar(100) DEFAULT NULL,
  `up_votes` int(11) NOT NULL DEFAULT '0',
  `down_votes` int(11) NOT NULL DEFAULT '0',
  `total_redemption` int(11) NOT NULL DEFAULT '0',
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  INDEX(`user_id`),
  INDEX(`unique_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;



