-- Table structure for table `vtiger_sarvsurveyresponses`
--

CREATE TABLE `vtiger_sarvsurveyresponses` (
  `sarvsurveyresponsesid` int(19) NOT NULL,
  `response_no` varchar(100) DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `accountid` int(19) DEFAULT NULL,
  `contactid` int(19) DEFAULT NULL,
  `survey_title` varchar(255) DEFAULT NULL,
  `response_status` varchar(255) DEFAULT NULL,
  `channel` varchar(255) DEFAULT NULL,
  `started_at` datetime DEFAULT NULL,
  `submitted_at` datetime DEFAULT NULL,
  `score` decimal(10,2) DEFAULT NULL,
  `nps` int(3) DEFAULT NULL,
  `answers_json` mediumtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sarvsurveyresponses`
--

INSERT IGNORE INTO `vtiger_sarvsurveyresponses` (`sarvsurveyresponsesid`, `response_no`, `subject`, `accountid`, `contactid`, `survey_title`, `response_status`, `channel`, `started_at`, `submitted_at`, `score`, `nps`, `answers_json`) VALUES
(2153, 'SRV1', 'پاسخ واقعی نظرسنجی رضایت حساب 2036 [Gouya-PHASE04]', 2036, 2107, 'سنجش رضایت از فرایند فروش', 'Submitted', 'Web', '2026-07-18 02:58:33', '2026-07-18 03:03:33', 92.50, 9, '{\"overall_satisfaction\":9,\"recommendation\":9,\"comment\":\"پاسخ واقعی آزمایشی فاز چهارم\"}');

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

--
-- Table structure for table `vtiger_sarvsurveyresponsescf`
--

CREATE TABLE `vtiger_sarvsurveyresponsescf` (
  `sarvsurveyresponsesid` int(19) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sarvsurveyresponsescf`
--

INSERT IGNORE INTO `vtiger_sarvsurveyresponsescf` (`sarvsurveyresponsesid`) VALUES
(2153);

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

--
-- Table structure for table `vtiger_sarvtargetlists`
--

CREATE TABLE `vtiger_sarvtargetlists` (
  `sarvtargetlistsid` int(19) NOT NULL,
  `targetlist_no` varchar(100) DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `accountid` int(19) DEFAULT NULL,
  `list_type` varchar(255) DEFAULT NULL,
  `purpose` varchar(255) DEFAULT NULL,
  `list_status` varchar(255) DEFAULT NULL,
  `valid_from` date DEFAULT NULL,
  `valid_to` date DEFAULT NULL,
  `filter_definition` mediumtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sarvtargetlists`
--

INSERT IGNORE INTO `vtiger_sarvtargetlists` (`sarvtargetlistsid`, `targetlist_no`, `subject`, `accountid`, `list_type`, `purpose`, `list_status`, `valid_from`, `valid_to`, `filter_definition`) VALUES
(2216, 'TL1', 'لیست هدف واقعی حساب ۲۰۳۶ [Gouya-PHASE05]', 2036, 'Dynamic', 'پیگیری مشتریان فعال و دارای فرصت فروش', 'Active', '2026-07-18', '2026-10-16', '{\"version\":1,\"match\":\"all\",\"conditions\":[{\"field\":\"accountstatus\",\"operator\":\"eq\",\"value\":\"Active\"}]}');

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

--
-- Table structure for table `vtiger_sarvtargetlistscf`
--

CREATE TABLE `vtiger_sarvtargetlistscf` (
  `sarvtargetlistsid` int(19) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sarvtargetlistscf`
--

INSERT IGNORE INTO `vtiger_sarvtargetlistscf` (`sarvtargetlistsid`) VALUES
(2216);

--
-- Triggers `vtiger_sarvtimereservations`
--
DROP TRIGGER IF EXISTS `bi_sarvreservation_optional_refs`;
DELIMITER $$
DELIMITER ;
DROP TRIGGER IF EXISTS `bu_sarvreservation_optional_refs`;
DELIMITER $$
DELIMITER ;

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

--
-- Table structure for table `vtiger_sarvtimereservationscf`
--

CREATE TABLE `vtiger_sarvtimereservationscf` (
  `sarvtimereservationsid` int(19) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sarvtimereservationscf`
--

INSERT IGNORE INTO `vtiger_sarvtimereservationscf` (`sarvtimereservationsid`) VALUES
(2225);

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

--
-- Table structure for table `vtiger_sarv_delivery_format`
--

CREATE TABLE `vtiger_sarv_delivery_format` (
  `sarv_delivery_formatid` int(11) NOT NULL,
  `sarv_delivery_format` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(11) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT 0,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sarv_delivery_format`
--

INSERT IGNORE INTO `vtiger_sarv_delivery_format` (`sarv_delivery_formatid`, `sarv_delivery_format`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'معمولی', 1, 477, 1, NULL),
(2, 'فوری', 1, 478, 2, NULL);

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

--
-- Table structure for table `vtiger_sarv_delivery_format_seq`
--

CREATE TABLE `vtiger_sarv_delivery_format_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `vtiger_sarv_delivery_format_seq`
--

INSERT IGNORE INTO `vtiger_sarv_delivery_format_seq` (`id`) VALUES
(2);

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

--
-- Table structure for table `vtiger_sarv_otp`
--

CREATE TABLE `vtiger_sarv_otp` (
  `id` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `mobile` varchar(20) NOT NULL,
  `code_hash` varchar(255) NOT NULL,
  `created_at` datetime NOT NULL,
  `expires_at` datetime NOT NULL,
  `attempts` int(11) DEFAULT 0,
  `used` tinyint(4) DEFAULT 0,
  `ip` varchar(45) DEFAULT NULL,
  `purpose` varchar(40) NOT NULL DEFAULT 'login',
  `context_hash` char(64) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sarv_otp`
--

INSERT IGNORE INTO `vtiger_sarv_otp` (`id`, `userid`, `mobile`, `code_hash`, `created_at`, `expires_at`, `attempts`, `used`, `ip`, `purpose`, `context_hash`) VALUES
(18, 1, '09119090378', '$2y$10$8tsaaiUXGd.ny3yTezPi7eDXp2UMrcGz7HHx34KJ/3LPBQchpAHUq', '2026-06-22 21:33:01', '2026-06-22 21:35:01', 0, 1, '::1', 'login', NULL),
(19, 1, '09119090378', '$2y$10$u/.svvsHN05hRazfUgt.8eTKRstu8iOhYA1qN8DJrTnjQcYQmVoHO', '2026-06-22 21:35:09', '2026-06-22 21:37:09', 0, 1, '::1', 'login', NULL),
(20, 1, '09119090378', '$2y$10$SJ5k6X8stZTxDMduT.gie.Fnx0.fWslU1q0XUJE9VBJoGiFsAFUke', '2026-06-22 21:44:47', '2026-06-22 21:46:47', 0, 1, '::1', 'login', NULL),
(21, 1, '09119090378', '$2y$10$jLVKvdts..X.o.R1ZmrVY.N/tGVeU2HOe6CAb2f3Ka9bJrqmg1Q5q', '2026-06-22 21:47:14', '2026-06-22 21:49:14', 0, 1, '::1', 'login', NULL),
(22, 5, '09119220020', '$2y$10$SYMHjci88UEn1vtDulG8kOguJ.c69RZviTvJuyYRy6h32Z8IbMt.C', '2026-06-22 21:49:47', '2026-06-22 21:51:47', 0, 1, '::1', 'login', NULL),
(23, 1, '09119090378', '$2y$10$VmVyec2zu0pS/6UMrrVurOOTmBYXNwzCCpfja9sjsQ1V02diqCmT.', '2026-06-22 21:53:12', '2026-06-22 21:55:12', 0, 1, '::1', 'login', NULL),
(24, 5, '09119220020', '$2y$10$2TWQM/FNsNAg5S.DTdn9p.zdfBuSpgDavyehzIwcLx5WXAPF.pSya', '2026-06-22 22:13:44', '2026-06-22 22:15:44', 0, 1, '::1', 'login', NULL),
(25, 1, '09119090378', '$2y$10$qjLHp09/Nn/TaqRJeNjRP.rs03mIxW2zY5KfNIs8FYBH5vkZogqJ6', '2026-06-22 22:30:58', '2026-06-22 22:32:58', 0, 1, '::1', 'login', NULL),
(26, 1, '09119090378', '$2y$10$Lgu1XmDZY/ZbR5D6P936HeO.mhM/OtjtzUe.m33Gv9uZa3kDZD38e', '2026-06-23 09:40:26', '2026-06-23 09:42:26', 0, 1, '::1', 'login', NULL),
(27, 1, '09119090378', '$2y$10$ARQL03WBt7T6qAJbXUOmJuFiEbNBrSm/ACFi61kOTvYPYLj8aBxKm', '2026-06-23 19:41:27', '2026-06-23 19:43:27', 0, 1, '::1', 'login', NULL),
(28, 1, '09119090378', '$2y$10$IJs0Z9GEeylPV1.3fhbT2.WsHCFunsLWqhwrwsjRF8f3yKCLDm4C6', '2026-06-27 19:36:30', '2026-06-27 19:38:30', 0, 1, '::1', 'login', NULL),
(29, 1, '09119090378', '$2y$10$mAm68StiBlq36ly3LUQmn.YxoYiQL9f.h.n22Sa/ts14ZEtirxC.G', '2026-06-28 09:41:36', '2026-06-28 09:43:36', 0, 1, '::1', 'login', NULL),
(30, 1, '09119090378', '$2y$10$T2btgB5Sa1pw476q5CjBmuvUYT0eHJSrdcGQLbaIXSThce1Btdzhu', '2026-06-28 13:37:36', '2026-06-28 13:39:36', 0, 1, '::1', 'login', NULL),
(31, 1, '09119090378', '$2y$10$CZQBBmpDXcseptG5xk1KTOZVK.uWoWqW1GmFqp50r6KvpmKdTU4Jq', '2026-06-28 19:14:48', '2026-06-28 19:16:48', 0, 1, '::1', 'login', NULL),
(32, 1, '09119090378', '$2y$10$TPPkOK3cvcunVTi4POG.IO1/0YQmAQiJtBANJv2HJ7AadB7Wf2RIK', '2026-06-28 23:38:13', '2026-06-28 23:40:13', 0, 1, '::1', 'login', NULL),
(33, 1, '09119090378', '$2y$10$QqyJZjb4.j294Ar0RocQ0OZ3vAYVYR3lSj0.FiQaKjRIRUHwEBsja', '2026-06-28 23:39:58', '2026-06-28 23:41:58', 0, 1, '::1', 'login', NULL),
(34, 1, '09119090378', '$2y$10$M7V90q1omMKQUdKKMIdmaeFoP4qeNaJygwzFJ6Wj32VSRQPseU53e', '2026-06-28 23:41:08', '2026-06-28 23:43:08', 0, 1, '::1', 'login', NULL),
(35, 1, '09119090378', '$2y$10$9haSminrExBYjO8TUqG2AuWzJ4XgtnmydGhT36Aljdw76si16Cp5u', '2026-06-29 21:16:48', '2026-06-29 21:18:48', 0, 1, '::1', 'login', NULL),
(36, 1, '09119090378', '$2y$10$XHObHYveItuvPEwxeYTa3OxiLgzb5GajSYp/tke4Ca4CGl3X9Ki1K', '2026-06-30 08:56:58', '2026-06-30 08:58:58', 0, 1, '::1', 'login', NULL),
(37, 1, '09119090378', '$2y$10$qZCMF.QcID57micvbLowge0WQZiN.ukwKqYFl.K0.JHwZ5s/DrD9O', '2026-06-30 15:11:15', '2026-06-30 15:13:15', 0, 1, '::1', 'login', NULL),
(38, 1, '09119090378', '$2y$10$BUC8KIT83ZqJ2Zs6Ed5m8e5leL3QK3R8SSrzLxdATWDJiMaRGskru', '2026-07-07 09:45:52', '2026-07-07 09:47:52', 1, 1, '::1', 'login', NULL),
(39, 1, '09119090378', '$2y$10$P6zK1dvi4xcyyrgXGIfm6.BQjDKJC/0pkAzudOFna/uI/rIDvPGAC', '2026-07-11 00:43:54', '2026-07-11 00:45:54', 0, 1, '::1', 'login', NULL),
(40, 1, '09119090378', '$2y$10$jHrPU4xOnMU.ibEHcgjWZ.OCqFrMVy9o7njAqLgmk6f1UYg9nVJei', '2026-07-11 11:10:40', '2026-07-11 11:12:40', 1, 1, '::1', 'login', NULL),
(41, 1, '09119090378', '$2y$10$rc35kWQcQ2BoCuIKDSEwluj1KTmikIiZB6DRmOtm/MGoPlRC3Mccq', '2026-07-14 01:49:59', '2026-07-14 01:51:59', 0, 1, '::1', 'login', NULL),
(42, 1, '09119090378', '$2y$10$eBf0Eh0pikV4NQer/uC8LOIocDGT2aTNxqrMVn/YpIqhOWKuw0/02', '2026-07-14 12:55:15', '2026-07-14 12:57:15', 0, 1, '::1', 'login', NULL),
(43, 1, '09119090378', '$2y$10$1kfiLXE7XfbfMMGvjnakOexnJBBZXGHd0xLizJq1odNQ.EOPl6nUC', '2026-07-14 16:25:01', '2026-07-14 16:27:01', 0, 1, '::1', 'login', NULL),
(44, 1, '09119090378', '$2y$10$2WwEeAo3ogZ2DfoExWIX.eMPQDTj5zyh9m/xtNm7vFnnERB738Pd.', '2026-07-14 16:38:30', '2026-07-14 16:40:30', 0, 1, '::1', 'login', NULL),
(45, 1, '09119090378', '$2y$10$ar89hfdOYgWr4sy0oqScVOYkK3/5Jak8zqLWEO4Q5jkmhAmgQuDf.', '2026-07-14 16:40:24', '2026-07-14 16:42:24', 0, 1, '::1', 'login', NULL),
(46, 1, '09119090378', '$2y$10$A/1cIxMneQDVpgX2NBwe0uiu8F/2YTFaYh1Ijs0H7Fu1ArfrLwBhC', '2026-07-14 16:41:19', '2026-07-14 16:43:19', 0, 1, '::1', 'login', NULL),
(47, 1, '09119090378', '$2y$10$PC38sCNzIS2H9ySedkIMxetMO7b3Z41mEXcV8h5a/9euzaIHaTIuS', '2026-07-14 16:54:12', '2026-07-14 16:56:12', 0, 1, '::1', 'login', NULL),
(48, 1, '09119090378', '$2y$10$20VMWncaf7QIEH8xJTgjjukdn0sJZY.CxyZzup8lebzurifklZAaS', '2026-07-14 19:27:33', '2026-07-14 19:29:33', 0, 1, '::1', 'login', NULL),
(49, 1, '09119090378', '$2y$10$WqPESzOd0OpsN6tvf6nahuRyms/VjfE2SOHGwd/xM1lxUhS4Uj3Sa', '2026-07-15 13:22:40', '2026-07-15 13:24:40', 0, 1, '::1', 'login', NULL),
(50, 1, '09119090378', '$2y$10$g55qyEMhJw838e1cW61gQuy/r9vuy5xKJYw.3dPmnvZqXwAgczAc.', '2026-07-15 13:29:03', '2026-07-15 13:31:03', 0, 1, '::1', 'login', NULL),
(51, 1, '09119090378', '$2y$10$NeXyuAGV0yaTWPSQa4fDpu0DopEr8rzXYyJwahC0odQDmueW.8sy.', '2026-07-16 01:47:24', '2026-07-16 01:49:24', 0, 1, '::1', 'login', NULL),
(52, 1, '09119090378', '$2y$10$S/FP0uJm0Cuwvpd11Q8ileyibf7lMmQOdFVx1BzO8WPxDtGwRG1wC', '2026-07-16 02:00:53', '2026-07-16 02:02:53', 0, 1, '::1', 'login', NULL),
(53, 1, '09119090378', '$2y$10$T6xjYmrGxqYb8y52xFWOAu/HntaA/K3TnYXY.vjDILjw8X/Ajxsxi', '2026-07-16 03:30:33', '2026-07-16 03:32:33', 0, 1, '::1', 'login', NULL),
(54, 1, '09119090378', '$2y$10$RrY.6xo7zFpnurOUfB6wWeEuR1D7/3n6P3n78H6.sYESyBK.Vx6kq', '2026-07-16 03:31:54', '2026-07-16 03:33:54', 0, 1, '::1', 'login', NULL),
(55, 1, '09119090378', '$2y$10$KakpAKSCROq1wYlP5K1L..oYgOq.dFaN99IhqxYOYTf7tNyBKlRu2', '2026-07-16 04:05:38', '2026-07-16 04:07:38', 0, 1, '::1', 'login', NULL),
(56, 1, '09119090378', '$2y$10$4zf5Rq/y3GVKElEwzRpQAeaNP0RDwDjFDEmuVYSvV9RQvwdrHIVE.', '2026-07-16 04:36:21', '2026-07-16 04:38:21', 0, 1, '::1', 'login', NULL),
(57, 1, '09119090378', '$2y$10$t96/jRHdwvH0vJWGsudCqe4SB5Sz0.AP7rim8uO0sCb.xgDf3L8Le', '2026-07-18 01:16:02', '2026-07-18 01:18:02', 0, 1, '::1', 'login', NULL),
(58, 1, '09119090378', '$2y$10$82Cg1T5DA.NOmyhglBI48Oe75Sq24xZHpnvHcC5kETb/hgi5OCu1q', '2026-07-18 01:26:37', '2026-07-18 01:28:37', 0, 1, '::1', 'login', NULL),
(59, 1, '09119090378', '$2y$10$r4qjKm8XDPEyW8qGxvqch.ShbvXhXnEPCYZHRm5.HtjOopTijIYWi', '2026-07-18 01:28:35', '2026-07-18 01:30:35', 0, 1, '::1', 'login', NULL),
(60, 1, '09119090378', '$2y$10$kRTE8V8HwXuo4vgeoN7UEu3.kfCrG2o74ytnfnQeEqR65d1L5MDVm', '2026-07-18 06:21:16', '2026-07-18 06:23:16', 0, 1, '::1', 'login', NULL),
(61, 1, '09119090378', '$2y$10$DKqXSCtL.0ahl2RllggRke30LRftQHzfboYNp6Vmf4RZYkDrYU6RO', '2026-07-18 12:55:50', '2026-07-18 12:57:50', 0, 1, '::1', 'login', NULL),
(62, 1, '09119090378', '$2y$10$K2KKsLlgGMs/mWGhp8/yQeuv.SoFRbcGOYmEskmK5joiFQf7Lgzjq', '2026-07-19 01:17:59', '2026-07-19 01:19:59', 1, 1, '::1', 'login', NULL),
(63, 1, '09119090378', '$2y$10$P4tVPAOl7NnT7GlRcMMzKuEdLMjQZHEg0TFQMlz/g2ymU4.Pfnysi', '2026-07-19 01:50:33', '2026-07-19 01:52:33', 0, 1, '::1', 'login', NULL),
(64, 1, '09119090378', '$2y$10$90..TCo3oX2MVxF.uhrZD.NaCuxyXj8bP6.9x.nPX8ZQ4kLVVU44y', '2026-07-19 01:51:34', '2026-07-19 01:53:34', 0, 1, '::1', 'login', NULL),
(65, 1, '09119090378', '$2y$10$EJqPD3ltMVQO7/BcT2gboebPSkuMELskY5JzOMsvGdNON3M8qOD6O', '2026-07-19 07:34:13', '2026-07-19 07:36:13', 0, 1, '::1', 'login', NULL),
(66, 1, '09119090378', '$2y$10$P.KQjX3BzwU5lVNiRGu75.e73DHP79q24tHJ.0AEDBLH9iTcAJNHO', '2026-07-20 06:14:04', '2026-07-20 06:16:04', 0, 1, '::1', 'login', NULL),
(67, 1, '09119090378', '$2y$10$NjSCy5mq509kUIEo.CGWFuL8I/bJftsQtmSxxJSmJE4nCUWon8CZa', '2026-07-20 07:13:52', '2026-07-20 07:15:52', 0, 1, '::1', 'login', NULL),
(68, 1, '09119090378', '$2y$10$PqXXZYy7tuXmZuoT6d7r2.0S.NlnTVESDjr5A8CmmznwTqSQiZIny', '2026-07-21 02:29:56', '2026-07-21 02:31:56', 0, 1, '::1', 'login', NULL),
(69, 1, '09119090378', '$2y$10$J2VdZXq/VQOGxGjJa7Ja5ODSG32vkgLzYZXq3VOdiopsGwddt1PeC', '2026-07-21 08:01:31', '2026-07-21 08:03:31', 0, 1, '::1', 'login', NULL),
(70, 1, '09119090378', '$2y$10$lPVKzuodDv7cPPj4cNR7Zex5xuxHE3k36cBqeZT73QbImfa8r8mfq', '2026-07-21 08:03:22', '2026-07-21 08:05:22', 0, 1, '::1', 'login', NULL),
(71, 1, '09119090378', '$2y$10$yclFWbVhuXrJ2qsB7zAHceEkPDWw1w6litftRnZ3sIcb5f3hfvI1O', '2026-07-21 08:04:44', '2026-07-21 08:06:44', 0, 1, '::1', 'login', NULL),
(72, 1, '09119090378', '$2y$10$T2BSAF.GHWJsXqOSlKqFZOXqXTWhwU8KpqaZAL864uGNeVeYQyoLy', '2026-07-22 01:21:27', '2026-07-22 01:23:27', 0, 1, '::1', 'login', NULL),
(73, 1, '09119090378', '$2y$10$2szn6ed.wDZsKqmUMZOgwe3/KgcoxIonXWrNN2HyYFD/mskJbtX8e', '2026-07-22 01:22:56', '2026-07-22 01:24:56', 0, 1, '::1', 'login', NULL),
(74, 1, '09119090378', '$2y$10$l06zJAoRbSnbf38i3ha9GusykaXtHuWX8GMl7J8A1pzqs1oLh5nJ.', '2026-07-22 01:24:02', '2026-07-22 01:26:02', 0, 1, '::1', 'login', NULL),
(75, 1, '09119090378', '$2y$10$WvZFLCxYNiEqRuyOgIu7PO1JRhYDawdiswOfwMAswb8vpJ/qI2h4K', '2026-07-22 04:07:58', '2026-07-22 04:09:58', 0, 1, '::1', 'login', NULL),
(76, 1, '09119090378', '$2y$10$GPH54pHqj.C/ce4zqyYftuiqaLI6NDYMXE4GH6/vBmgIcxbVqVNEC', '2026-07-23 08:25:21', '2026-07-23 08:27:21', 0, 1, '::1', 'login', NULL),
(77, 1, '09119090378', '$2y$10$bmaPUHyegCTDSQNp2Ayfdu5GwOyh4Lf6jb.iXQ28uT68KcTlsCrSO', '2026-07-25 03:25:19', '2026-07-25 03:27:19', 0, 1, '::1', 'login', NULL),
(78, 1, '09119090378', '$2y$10$V0LOCf/QRUxVcw0oQ98KD.7/MzuY06pO2DBrSmq1CnY7xJQ4XLrG.', '2026-07-26 09:26:49', '2026-07-26 09:28:49', 0, 1, '::1', 'login', NULL),
(79, 1, '09119090378', '$2y$10$HFXCO93YV9J0uh4TLYG2..r.WcMF.YGJaJrZ1V7iFDD4HvVcQkZU6', '2026-07-26 10:08:34', '2026-07-26 10:10:34', 0, 1, '::1', 'login', NULL),
(80, 1, '09119090378', '$2y$10$OeX9RC4YEK8qcFkAPWOlK.7Feo5aauufbIH81JNehT7dLhBI3Izdy', '2026-07-28 12:33:13', '2026-07-28 12:35:13', 0, 1, '::1', 'login', NULL),
(81, 1, '09119090378', '$2y$10$DR4dPc.0jsZJ6adfwpCLAuBr9CjDJJ00ozLJ30wW2N/39hpxmD8pS', '2026-08-17 13:48:05', '2026-08-17 13:50:05', 0, 0, '::1', 'login', NULL);

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

--
-- Table structure for table `vtiger_sarv_payment_method`
--

CREATE TABLE `vtiger_sarv_payment_method` (
  `sarv_payment_methodid` int(11) NOT NULL,
  `sarv_payment_method` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(11) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT 0,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sarv_payment_method`
--

INSERT IGNORE INTO `vtiger_sarv_payment_method` (`sarv_payment_methodid`, `sarv_payment_method`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'نقدی', 1, 479, 1, NULL),
(2, 'کارت', 1, 480, 2, NULL),
(3, 'انتقال بانکی', 1, 481, 3, NULL),
(4, 'چک', 1, 482, 4, NULL),
(5, 'اعتباری', 1, 483, 5, NULL);

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

--
-- Table structure for table `vtiger_sarv_payment_method_seq`
--

CREATE TABLE `vtiger_sarv_payment_method_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `vtiger_sarv_payment_method_seq`
--

INSERT IGNORE INTO `vtiger_sarv_payment_method_seq` (`id`) VALUES
(5);

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

--
-- Table structure for table `vtiger_sarv_payment_status`
--

CREATE TABLE `vtiger_sarv_payment_status` (
  `sarv_payment_statusid` int(11) NOT NULL,
  `sarv_payment_status` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(11) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT 0,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sarv_payment_status`
--

INSERT IGNORE INTO `vtiger_sarv_payment_status` (`sarv_payment_statusid`, `sarv_payment_status`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'پرداخت نشده', 1, 484, 1, NULL),
(2, 'بخشی پرداخت شده', 1, 485, 2, NULL),
(3, 'پرداخت شده', 1, 486, 3, NULL);

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

--
-- Table structure for table `vtiger_sarv_payment_status_seq`
--

CREATE TABLE `vtiger_sarv_payment_status_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `vtiger_sarv_payment_status_seq`
--

INSERT IGNORE INTO `vtiger_sarv_payment_status_seq` (`id`) VALUES
(3);

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

--
-- Table structure for table `vtiger_sarv_po_category`
--

CREATE TABLE `vtiger_sarv_po_category` (
  `sarv_po_categoryid` int(11) NOT NULL,
  `sarv_po_category` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(11) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT 0,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sarv_po_category`
--

INSERT IGNORE INTO `vtiger_sarv_po_category` (`sarv_po_categoryid`, `sarv_po_category`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'کالا', 1, 487, 1, NULL),
(2, 'خدمات', 1, 488, 2, NULL),
(3, 'تجهیزات', 1, 489, 3, NULL),
(4, 'مصرفی', 1, 490, 4, NULL),
(5, 'سایر', 1, 491, 5, NULL);

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

--
-- Table structure for table `vtiger_sarv_po_category_seq`
--

CREATE TABLE `vtiger_sarv_po_category_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `vtiger_sarv_po_category_seq`
--

INSERT IGNORE INTO `vtiger_sarv_po_category_seq` (`id`) VALUES
(5);

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

--
-- Table structure for table `vtiger_sarv_print_template`
--

CREATE TABLE `vtiger_sarv_print_template` (
  `sarv_print_templateid` int(11) NOT NULL,
  `sarv_print_template` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(11) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT 0,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sarv_print_template`
--

INSERT IGNORE INTO `vtiger_sarv_print_template` (`sarv_print_templateid`, `sarv_print_template`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'پیش‌فرض', 1, 492, 1, NULL),
(2, 'پیش‌فرض', 1, 493, 1, NULL);

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

--
-- Table structure for table `vtiger_sarv_print_template_seq`
--

CREATE TABLE `vtiger_sarv_print_template_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `vtiger_sarv_print_template_seq`
--

INSERT IGNORE INTO `vtiger_sarv_print_template_seq` (`id`) VALUES
(2);

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

--
-- Table structure for table `vtiger_sarv_shipping_method`
--

CREATE TABLE `vtiger_sarv_shipping_method` (
  `sarv_shipping_methodid` int(11) NOT NULL,
  `sarv_shipping_method` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(11) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT 0,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sarv_shipping_method`
--

INSERT IGNORE INTO `vtiger_sarv_shipping_method` (`sarv_shipping_methodid`, `sarv_shipping_method`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'دریایی', 1, 473, 1, NULL),
(2, 'هوایی', 1, 474, 2, NULL),
(3, 'زمینی', 1, 475, 3, NULL),
(4, 'قطار', 1, 476, 4, NULL);

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

--
-- Table structure for table `vtiger_sarv_shipping_method_seq`
--

CREATE TABLE `vtiger_sarv_shipping_method_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `vtiger_sarv_shipping_method_seq`
--

INSERT IGNORE INTO `vtiger_sarv_shipping_method_seq` (`id`) VALUES
(4);

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

--
-- Table structure for table `vtiger_sarv_sms_reminder`
--

CREATE TABLE `vtiger_sarv_sms_reminder` (
  `sarv_sms_reminderid` int(11) NOT NULL,
  `sarv_sms_reminder` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(11) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT 0,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sarv_sms_reminder`
--

INSERT IGNORE INTO `vtiger_sarv_sms_reminder` (`sarv_sms_reminderid`, `sarv_sms_reminder`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'بدون یادآوری', 1, 469, 1, NULL),
(2, 'روز سررسید', 1, 470, 2, NULL),
(3, 'یک روز قبل', 1, 471, 3, NULL),
(4, 'سه روز قبل', 1, 472, 4, NULL);

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

--
-- Table structure for table `vtiger_sarv_sms_reminder_seq`
--

CREATE TABLE `vtiger_sarv_sms_reminder_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `vtiger_sarv_sms_reminder_seq`
--

INSERT IGNORE INTO `vtiger_sarv_sms_reminder_seq` (`id`) VALUES
(4);

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

--
-- Table structure for table `vtiger_scheduled_reports`
--

CREATE TABLE `vtiger_scheduled_reports` (
  `reportid` int(11) NOT NULL,
  `recipients` text DEFAULT NULL,
  `schedule` text DEFAULT NULL,
  `format` varchar(10) DEFAULT NULL,
  `next_trigger_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_schedulereports`
--

CREATE TABLE `vtiger_schedulereports` (
  `reportid` int(10) DEFAULT NULL,
  `scheduleid` int(3) DEFAULT NULL,
  `recipients` text DEFAULT NULL,
  `schdate` varchar(20) DEFAULT NULL,
  `schtime` time DEFAULT NULL,
  `schdayoftheweek` varchar(100) DEFAULT NULL,
  `schdayofthemonth` varchar(100) DEFAULT NULL,
  `schannualdates` varchar(500) DEFAULT NULL,
  `specificemails` varchar(500) DEFAULT NULL,
  `next_trigger_time` timestamp NOT NULL DEFAULT current_timestamp(),
  `fileformat` varchar(10) DEFAULT 'CSV'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_seactivityrel`
--

CREATE TABLE `vtiger_seactivityrel` (
  `crmid` int(19) NOT NULL,
  `activityid` int(19) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_seactivityrel`
--

INSERT IGNORE INTO `vtiger_seactivityrel` (`crmid`, `activityid`) VALUES
(2, 9),
(2, 10),
(2, 18),
(2, 19),
(1001, 16),
(1001, 17),
(1006, 2061),
(1006, 2062),
(2034, 2132),
(2034, 2133),
(2036, 2134),
(2052, 2263),
(2052, 2264),
(2052, 2265),
(2063, 2229),
(2063, 2230),
(2063, 2231),
(2157, 2160),
(2166, 2165),
(2169, 2172),
(2175, 2178),
(2181, 2184),
(2187, 2190),
(2198, 2196),
(2206, 2204),
(2214, 2212),
(2275, 2273),
(2297, 2300),
(2302, 2305),
(2312, 2310),
(2320, 2318),
(2328, 2326),
(2336, 2334),
(2344, 2342),
(2352, 2350),
(2363, 2366);

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

--
-- Table structure for table `vtiger_seactivityrel_seq`
--

CREATE TABLE `vtiger_seactivityrel_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_seactivityrel_seq`
--

INSERT IGNORE INTO `vtiger_seactivityrel_seq` (`id`) VALUES
(1);

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

--
-- Table structure for table `vtiger_seattachmentsrel`
--

CREATE TABLE `vtiger_seattachmentsrel` (
  `crmid` int(19) NOT NULL DEFAULT 0,
  `attachmentsid` int(19) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_seattachmentsrel`
--

INSERT IGNORE INTO `vtiger_seattachmentsrel` (`crmid`, `attachmentsid`) VALUES
(2158, 2159),
(2163, 2164),
(2170, 2171),
(2176, 2177),
(2182, 2183),
(2188, 2189),
(2194, 2195),
(2202, 2203),
(2210, 2211),
(2277, 2278),
(2298, 2299),
(2303, 2304),
(2308, 2309),
(2316, 2317),
(2324, 2325),
(2332, 2333),
(2340, 2341),
(2348, 2349);

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

--
-- Table structure for table `vtiger_selectcolumn`
--

CREATE TABLE `vtiger_selectcolumn` (
  `queryid` int(19) NOT NULL,
  `columnindex` int(11) NOT NULL DEFAULT 0,
  `columnname` varchar(250) DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_selectcolumn`
--

INSERT IGNORE INTO `vtiger_selectcolumn` (`queryid`, `columnindex`, `columnname`) VALUES
(1, 0, 'vtiger_contactdetails:firstname:Contacts_First_Name:firstname:V'),
(1, 1, 'vtiger_contactdetails:lastname:Contacts_Last_Name:lastname:V'),
(1, 2, 'vtiger_contactsubdetails:leadsource:Contacts_Lead_Source:leadsource:V'),
(1, 3, 'vtiger_contactdetails:accountid:Contacts_Account_Name:account_id:V'),
(1, 4, 'vtiger_account:industry:Accounts_industry:industry:V'),
(1, 5, 'vtiger_contactdetails:email:Contacts_Email:email:E'),
(2, 0, 'vtiger_contactdetails:firstname:Contacts_First_Name:firstname:V'),
(2, 1, 'vtiger_contactdetails:lastname:Contacts_Last_Name:lastname:V'),
(2, 2, 'vtiger_contactsubdetails:leadsource:Contacts_Lead_Source:leadsource:V'),
(2, 3, 'vtiger_contactdetails:accountid:Contacts_Account_Name:account_id:V'),
(2, 4, 'vtiger_account:industry:Accounts_industry:industry:V'),
(2, 5, 'vtiger_contactdetails:email:Contacts_Email:email:E'),
(3, 0, 'vtiger_contactdetails:firstname:Contacts_First_Name:firstname:V'),
(3, 1, 'vtiger_contactdetails:lastname:Contacts_Last_Name:lastname:V'),
(3, 2, 'vtiger_contactdetails:accountid:Contacts_Account_Name:account_id:V'),
(3, 3, 'vtiger_contactdetails:email:Contacts_Email:email:E'),
(3, 4, 'vtiger_potential:potentialname:Potentials_Potential_Name:potentialname:V'),
(3, 5, 'vtiger_potential:sales_stage:Potentials_Sales_Stage:sales_stage:V'),
(4, 0, 'vtiger_leaddetails:firstname:Leads_First_Name:firstname:V'),
(4, 1, 'vtiger_leaddetails:lastname:Leads_Last_Name:lastname:V'),
(4, 2, 'vtiger_leaddetails:company:Leads_Company:company:V'),
(4, 3, 'vtiger_leaddetails:email:Leads_Email:email:E'),
(4, 4, 'vtiger_leaddetails:leadsource:Leads_Lead_Source:leadsource:V'),
(5, 0, 'vtiger_leaddetails:firstname:Leads_First_Name:firstname:V'),
(5, 1, 'vtiger_leaddetails:lastname:Leads_Last_Name:lastname:V'),
(5, 2, 'vtiger_leaddetails:company:Leads_Company:company:V'),
(5, 3, 'vtiger_leaddetails:email:Leads_Email:email:E'),
(5, 4, 'vtiger_leaddetails:leadsource:Leads_Lead_Source:leadsource:V'),
(5, 5, 'vtiger_leaddetails:leadstatus:Leads_Lead_Status:leadstatus:V'),
(6, 0, 'vtiger_potential:potentialname:Potentials_Potential_Name:potentialname:V'),
(6, 1, 'vtiger_potential:amount:Potentials_Amount:amount:N'),
(6, 2, 'vtiger_potential:potentialtype:Potentials_Type:opportunity_type:V'),
(6, 3, 'vtiger_potential:leadsource:Potentials_Lead_Source:leadsource:V'),
(6, 4, 'vtiger_potential:sales_stage:Potentials_Sales_Stage:sales_stage:V'),
(7, 0, 'vtiger_potential:potentialname:Potentials_Potential_Name:potentialname:V'),
(7, 1, 'vtiger_potential:amount:Potentials_Amount:amount:N'),
(7, 2, 'vtiger_potential:potentialtype:Potentials_Type:opportunity_type:V'),
(7, 3, 'vtiger_potential:leadsource:Potentials_Lead_Source:leadsource:V'),
(7, 4, 'vtiger_potential:sales_stage:Potentials_Sales_Stage:sales_stage:V'),
(8, 0, 'vtiger_activity:subject:Calendar_Subject:subject:V'),
(8, 1, 'vtiger_contactdetailsCalendar:lastname:Calendar_Contact_Name:contact_id:I'),
(8, 2, 'vtiger_activity:status:Calendar_Status:taskstatus:V'),
(8, 3, 'vtiger_activity:priority:Calendar_Priority:taskpriority:V'),
(8, 4, 'vtiger_usersCalendar:user_name:Calendar_Assigned_To:assigned_user_id:V'),
(9, 0, 'vtiger_activity:subject:Calendar_Subject:subject:V'),
(9, 1, 'vtiger_contactdetailsCalendar:lastname:Calendar_Contact_Name:contact_id:I'),
(9, 2, 'vtiger_activity:status:Calendar_Status:taskstatus:V'),
(9, 3, 'vtiger_activity:priority:Calendar_Priority:taskpriority:V'),
(9, 4, 'vtiger_usersCalendar:user_name:Calendar_Assigned_To:assigned_user_id:V'),
(10, 0, 'vtiger_troubletickets:title:HelpDesk_Title:ticket_title:V'),
(10, 1, 'vtiger_troubletickets:status:HelpDesk_Status:ticketstatus:V'),
(10, 2, 'vtiger_products:productname:Products_Product_Name:productname:V'),
(10, 3, 'vtiger_products:discontinued:Products_Product_Active:discontinued:V'),
(10, 4, 'vtiger_products:productcategory:Products_Product_Category:productcategory:V'),
(10, 5, 'vtiger_products:manufacturer:Products_Manufacturer:manufacturer:V'),
(11, 0, 'vtiger_troubletickets:title:HelpDesk_Title:ticket_title:V'),
(11, 1, 'vtiger_troubletickets:priority:HelpDesk_Priority:ticketpriorities:V'),
(11, 2, 'vtiger_troubletickets:severity:HelpDesk_Severity:ticketseverities:V'),
(11, 3, 'vtiger_troubletickets:status:HelpDesk_Status:ticketstatus:V'),
(11, 4, 'vtiger_troubletickets:category:HelpDesk_Category:ticketcategories:V'),
(11, 5, 'vtiger_usersHelpDesk:user_name:HelpDesk_Assigned_To:assigned_user_id:V'),
(12, 0, 'vtiger_troubletickets:title:HelpDesk_Title:ticket_title:V'),
(12, 1, 'vtiger_troubletickets:priority:HelpDesk_Priority:ticketpriorities:V'),
(12, 2, 'vtiger_troubletickets:severity:HelpDesk_Severity:ticketseverities:V'),
(12, 3, 'vtiger_troubletickets:status:HelpDesk_Status:ticketstatus:V'),
(12, 4, 'vtiger_troubletickets:category:HelpDesk_Category:ticketcategories:V'),
(12, 5, 'vtiger_usersHelpDesk:user_name:HelpDesk_Assigned_To:assigned_user_id:V'),
(13, 0, 'vtiger_products:productname:Products_Product_Name:productname:V'),
(13, 1, 'vtiger_products:productcode:Products_Product_Code:productcode:V'),
(13, 2, 'vtiger_products:discontinued:Products_Product_Active:discontinued:V'),
(13, 3, 'vtiger_products:productcategory:Products_Product_Category:productcategory:V'),
(13, 4, 'vtiger_products:website:Products_Website:website:V'),
(13, 5, 'vtiger_vendorRelProducts:vendorname:Products_Vendor_Name:vendor_id:I'),
(13, 6, 'vtiger_products:mfr_part_no:Products_Mfr_PartNo:mfr_part_no:V'),
(14, 0, 'vtiger_products:productname:Products_Product_Name:productname:V'),
(14, 1, 'vtiger_products:manufacturer:Products_Manufacturer:manufacturer:V'),
(14, 2, 'vtiger_products:productcategory:Products_Product_Category:productcategory:V'),
(14, 3, 'vtiger_contactdetails:firstname:Contacts_First_Name:firstname:V'),
(14, 4, 'vtiger_contactdetails:lastname:Contacts_Last_Name:lastname:V'),
(14, 5, 'vtiger_contactsubdetails:leadsource:Contacts_Lead_Source:leadsource:V'),
(15, 0, 'vtiger_quotes:subject:Quotes_Subject:subject:V'),
(15, 1, 'vtiger_potentialRelQuotes:potentialname:Quotes_Potential_Name:potential_id:I'),
(15, 2, 'vtiger_quotes:quotestage:Quotes_Quote_Stage:quotestage:V'),
(15, 3, 'vtiger_quotes:contactid:Quotes_Contact_Name:contact_id:V'),
(15, 4, 'vtiger_usersRel1:user_name:Quotes_Inventory_Manager:assigned_user_id1:I'),
(15, 5, 'vtiger_accountQuotes:accountname:Quotes_Account_Name:account_id:I'),
(16, 0, 'vtiger_quotes:subject:Quotes_Subject:subject:V'),
(16, 1, 'vtiger_potentialRelQuotes:potentialname:Quotes_Potential_Name:potential_id:I'),
(16, 2, 'vtiger_quotes:quotestage:Quotes_Quote_Stage:quotestage:V'),
(16, 3, 'vtiger_quotes:contactid:Quotes_Contact_Name:contact_id:V'),
(16, 4, 'vtiger_usersRel1:user_name:Quotes_Inventory_Manager:assigned_user_id1:I'),
(16, 5, 'vtiger_accountQuotes:accountname:Quotes_Account_Name:account_id:I'),
(16, 6, 'vtiger_quotes:carrier:Quotes_Carrier:carrier:V'),
(16, 7, 'vtiger_quotes:shipping:Quotes_Shipping:shipping:V'),
(17, 0, 'vtiger_purchaseorder:subject:PurchaseOrder_Subject:subject:V'),
(17, 1, 'vtiger_vendorRelPurchaseOrder:vendorname:PurchaseOrder_Vendor_Name:vendor_id:I'),
(17, 2, 'vtiger_purchaseorder:tracking_no:PurchaseOrder_Tracking_Number:tracking_no:V'),
(17, 3, 'vtiger_contactdetails:firstname:Contacts_First_Name:firstname:V'),
(17, 4, 'vtiger_contactdetails:lastname:Contacts_Last_Name:lastname:V'),
(17, 5, 'vtiger_contactsubdetails:leadsource:Contacts_Lead_Source:leadsource:V'),
(17, 6, 'vtiger_contactdetails:email:Contacts_Email:email:E'),
(18, 0, 'vtiger_purchaseorder:subject:PurchaseOrder_Subject:subject:V'),
(18, 1, 'vtiger_vendorRelPurchaseOrder:vendorname:PurchaseOrder_Vendor_Name:vendor_id:I'),
(18, 2, 'vtiger_purchaseorder:requisition_no:PurchaseOrder_Requisition_No:requisition_no:V'),
(18, 3, 'vtiger_purchaseorder:tracking_no:PurchaseOrder_Tracking_Number:tracking_no:V'),
(18, 4, 'vtiger_contactdetailsPurchaseOrder:lastname:PurchaseOrder_Contact_Name:contact_id:I'),
(18, 5, 'vtiger_purchaseorder:carrier:PurchaseOrder_Carrier:carrier:V'),
(18, 6, 'vtiger_purchaseorder:salescommission:PurchaseOrder_Sales_Commission:salescommission:N'),
(18, 7, 'vtiger_purchaseorder:exciseduty:PurchaseOrder_Excise_Duty:exciseduty:N'),
(18, 8, 'vtiger_usersPurchaseOrder:user_name:PurchaseOrder_Assigned_To:assigned_user_id:V'),
(19, 0, 'vtiger_invoice:subject:Invoice_Subject:subject:V'),
(19, 1, 'vtiger_invoice:salesorderid:Invoice_Sales_Order:salesorder_id:I'),
(19, 2, 'vtiger_invoice:customerno:Invoice_Customer_No:customerno:V'),
(19, 3, 'vtiger_invoice:exciseduty:Invoice_Excise_Duty:exciseduty:N'),
(19, 4, 'vtiger_invoice:salescommission:Invoice_Sales_Commission:salescommission:N'),
(19, 5, 'vtiger_accountInvoice:accountname:Invoice_Account_Name:account_id:I'),
(20, 0, 'vtiger_salesorder:subject:SalesOrder_Subject:subject:V'),
(20, 1, 'vtiger_quotesSalesOrder:subject:SalesOrder_Quote_Name:quote_id:I'),
(20, 2, 'vtiger_contactdetailsSalesOrder:lastname:SalesOrder_Contact_Name:contact_id:I'),
(20, 3, 'vtiger_salesorder:duedate:SalesOrder_Due_Date:duedate:D'),
(20, 4, 'vtiger_salesorder:carrier:SalesOrder_Carrier:carrier:V'),
(20, 5, 'vtiger_salesorder:sostatus:SalesOrder_Status:sostatus:V'),
(20, 6, 'vtiger_accountSalesOrder:accountname:SalesOrder_Account_Name:account_id:I'),
(20, 7, 'vtiger_salesorder:salescommission:SalesOrder_Sales_Commission:salescommission:N'),
(20, 8, 'vtiger_salesorder:exciseduty:SalesOrder_Excise_Duty:exciseduty:N'),
(20, 9, 'vtiger_usersSalesOrder:user_name:SalesOrder_Assigned_To:assigned_user_id:V'),
(21, 0, 'vtiger_campaign:campaignname:Campaigns_Campaign_Name:campaignname:V'),
(21, 1, 'vtiger_campaign:campaigntype:Campaigns_Campaign_Type:campaigntype:V'),
(21, 2, 'vtiger_campaign:targetaudience:Campaigns_Target_Audience:targetaudience:V'),
(21, 3, 'vtiger_campaign:budgetcost:Campaigns_Budget_Cost:budgetcost:I'),
(21, 4, 'vtiger_campaign:actualcost:Campaigns_Actual_Cost:actualcost:I'),
(21, 5, 'vtiger_campaign:expectedrevenue:Campaigns_Expected_Revenue:expectedrevenue:I'),
(21, 6, 'vtiger_campaign:expectedsalescount:Campaigns_Expected_Sales_Count:expectedsalescount:N'),
(21, 7, 'vtiger_campaign:actualsalescount:Campaigns_Actual_Sales_Count:actualsalescount:N'),
(21, 8, 'vtiger_usersCampaigns:user_name:Campaigns_Assigned_To:assigned_user_id:V'),
(22, 0, 'vtiger_contactdetails:lastname:Contacts_Last_Name:lastname:V'),
(22, 1, 'vtiger_contactdetails:email:Contacts_Email:email:E'),
(22, 2, 'vtiger_activity:subject:Emails_Subject:subject:V'),
(22, 3, 'vtiger_email_track:access_count:Emails_Access_Count:access_count:I'),
(23, 0, 'vtiger_account:accountname:Accounts_Account_Name:accountname:V'),
(23, 1, 'vtiger_account:phone:Accounts_Phone:phone:V'),
(23, 2, 'vtiger_account:email1:Accounts_Email:email1:E'),
(23, 3, 'vtiger_activity:subject:Emails_Subject:subject:V'),
(23, 4, 'vtiger_email_track:access_count:Emails_Access_Count:access_count:I'),
(24, 0, 'vtiger_leaddetails:lastname:Leads_Last_Name:lastname:V'),
(24, 1, 'vtiger_leaddetails:company:Leads_Company:company:V'),
(24, 2, 'vtiger_leaddetails:email:Leads_Email:email:E'),
(24, 3, 'vtiger_activity:subject:Emails_Subject:subject:V'),
(24, 4, 'vtiger_email_track:access_count:Emails_Access_Count:access_count:I'),
(25, 0, 'vtiger_vendor:vendorname:Vendors_Vendor_Name:vendorname:V'),
(25, 1, 'vtiger_vendor:glacct:Vendors_GL_Account:glacct:V'),
(25, 2, 'vtiger_vendor:email:Vendors_Email:email:E'),
(25, 3, 'vtiger_activity:subject:Emails_Subject:subject:V'),
(25, 4, 'vtiger_email_track:access_count:Emails_Access_Count:access_count:I');

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

--
-- Table structure for table `vtiger_selectquery`
--

CREATE TABLE `vtiger_selectquery` (
  `queryid` int(19) NOT NULL,
  `startindex` int(19) DEFAULT 0,
  `numofobjects` int(19) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_selectquery`
--

INSERT IGNORE INTO `vtiger_selectquery` (`queryid`, `startindex`, `numofobjects`) VALUES
(1, 0, 0),
(2, 0, 0),
(3, 0, 0),
(4, 0, 0),
(5, 0, 0),
(6, 0, 0),
(7, 0, 0),
(8, 0, 0),
(9, 0, 0),
(10, 0, 0),
(11, 0, 0),
(12, 0, 0),
(13, 0, 0),
(14, 0, 0),
(15, 0, 0),
(16, 0, 0),
(17, 0, 0),
(18, 0, 0),
(19, 0, 0),
(20, 0, 0),
(21, 0, 0),
(22, 0, 0),
(23, 0, 0),
(24, 0, 0),
(25, 0, 0);

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

--
-- Table structure for table `vtiger_selectquery_seq`
--

CREATE TABLE `vtiger_selectquery_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_selectquery_seq`
--

INSERT IGNORE INTO `vtiger_selectquery_seq` (`id`) VALUES
(25);

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

--
-- Table structure for table `vtiger_senotesrel`
--

CREATE TABLE `vtiger_senotesrel` (
  `crmid` int(19) NOT NULL DEFAULT 0,
  `notesid` int(19) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_senotesrel`
--

INSERT IGNORE INTO `vtiger_senotesrel` (`crmid`, `notesid`) VALUES
(2052, 2267),
(2063, 2233),
(2157, 2158),
(2162, 2163),
(2166, 2163),
(2169, 2170),
(2175, 2176),
(2181, 2182),
(2187, 2188),
(2193, 2194),
(2198, 2194),
(2201, 2202),
(2206, 2202),
(2209, 2210),
(2214, 2210),
(2297, 2298),
(2302, 2303),
(2307, 2308),
(2312, 2308),
(2315, 2316),
(2320, 2316),
(2323, 2324),
(2328, 2324),
(2331, 2332),
(2336, 2332),
(2339, 2340),
(2344, 2340),
(2347, 2348),
(2352, 2348),
(2363, 2364);

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

--
-- Table structure for table `vtiger_seproductsrel`
--

CREATE TABLE `vtiger_seproductsrel` (
  `crmid` int(19) NOT NULL DEFAULT 0,
  `productid` int(19) NOT NULL DEFAULT 0,
  `setype` varchar(30) NOT NULL,
  `quantity` int(19) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_service`
--

CREATE TABLE `vtiger_service` (
  `serviceid` int(11) NOT NULL,
  `service_no` varchar(100) NOT NULL,
  `servicename` varchar(255) DEFAULT NULL,
  `servicecategory` varchar(200) DEFAULT NULL,
  `qty_per_unit` decimal(11,2) DEFAULT 0.00,
  `unit_price` decimal(25,8) DEFAULT NULL,
  `sales_start_date` date DEFAULT NULL,
  `sales_end_date` date DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `discontinued` int(1) NOT NULL DEFAULT 0,
  `service_usageunit` varchar(200) DEFAULT NULL,
  `website` varchar(100) DEFAULT NULL,
  `taxclass` varchar(200) DEFAULT NULL,
  `currency_id` int(19) NOT NULL DEFAULT 1,
  `commissionrate` decimal(7,3) DEFAULT NULL,
  `tags` varchar(1) DEFAULT NULL,
  `purchase_cost` decimal(27,8) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_servicecategory`
--

CREATE TABLE `vtiger_servicecategory` (
  `servicecategoryid` int(11) NOT NULL,
  `servicecategory` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(11) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT 0,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_servicecategory`
--

INSERT IGNORE INTO `vtiger_servicecategory` (`servicecategoryid`, `servicecategory`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(2, 'Support', 1, 230, 2, NULL),
(3, 'Installation', 1, 231, 3, NULL),
(4, 'Migration', 1, 232, 4, NULL),
(5, 'Customization', 1, 233, 5, NULL),
(6, 'Training', 1, 234, 6, NULL);

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

--
-- Table structure for table `vtiger_servicecategory_seq`
--

CREATE TABLE `vtiger_servicecategory_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_servicecategory_seq`
--

INSERT IGNORE INTO `vtiger_servicecategory_seq` (`id`) VALUES
(6);

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

--
-- Table structure for table `vtiger_servicecf`
--

CREATE TABLE `vtiger_servicecf` (
  `serviceid` int(19) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_servicecontracts`
--

CREATE TABLE `vtiger_servicecontracts` (
  `servicecontractsid` int(11) DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `sc_related_to` int(11) DEFAULT NULL,
  `tracking_unit` varchar(100) DEFAULT NULL,
  `total_units` decimal(5,2) DEFAULT NULL,
  `used_units` decimal(5,2) DEFAULT NULL,
  `subject` varchar(100) DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `planned_duration` varchar(256) DEFAULT NULL,
  `actual_duration` varchar(256) DEFAULT NULL,
  `contract_status` varchar(200) DEFAULT NULL,
  `priority` varchar(200) DEFAULT NULL,
  `contract_type` varchar(200) DEFAULT NULL,
  `progress` decimal(5,2) DEFAULT NULL,
  `contract_no` varchar(100) DEFAULT NULL,
  `tags` varchar(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_servicecontracts`
--

INSERT IGNORE INTO `vtiger_servicecontracts` (`servicecontractsid`, `start_date`, `end_date`, `sc_related_to`, `tracking_unit`, `total_units`, `used_units`, `subject`, `due_date`, `planned_duration`, `actual_duration`, `contract_status`, `priority`, `contract_type`, `progress`, `contract_no`, `tags`) VALUES
(2000, '2026-06-04', '2026-08-07', NULL, NULL, 75.00, 3.00, 'قرارداد سرویس 1', NULL, NULL, NULL, 'Undefined', NULL, NULL, 46.00, 'SERCON2000', NULL),
(2001, '2026-06-05', '2026-09-25', NULL, NULL, 85.00, 8.00, 'قرارداد سرویس 2', NULL, NULL, NULL, 'In Planning', NULL, NULL, 78.00, 'SERCON2001', NULL),
(2002, '2026-05-13', '2026-11-10', NULL, NULL, 27.00, 9.00, 'قرارداد سرویس 3', NULL, NULL, NULL, 'In Progress', NULL, NULL, 6.00, 'SERCON2002', NULL),
(2003, '2026-05-01', '2026-08-25', NULL, NULL, 53.00, 4.00, 'قرارداد سرویس 4', NULL, NULL, NULL, 'On Hold', NULL, NULL, 61.00, 'SERCON2003', NULL),
(2004, '2026-05-02', '2026-11-09', NULL, NULL, 89.00, 6.00, 'قرارداد سرویس 5', NULL, NULL, NULL, 'Complete', NULL, NULL, 58.00, 'SERCON2004', NULL),
(2005, '2026-04-01', '2026-07-31', NULL, NULL, 35.00, 4.00, 'قرارداد سرویس 6', NULL, NULL, NULL, 'Archived', NULL, NULL, 37.00, 'SERCON2005', NULL),
(2006, '2026-05-25', '2026-11-08', NULL, NULL, 47.00, 2.00, 'قرارداد سرویس 7', NULL, NULL, NULL, 'Undefined', NULL, NULL, 12.00, 'SERCON2006', NULL),
(2007, '2026-05-02', '2026-07-28', NULL, NULL, 94.00, 6.00, 'قرارداد سرویس 8', NULL, NULL, NULL, 'In Planning', NULL, NULL, 69.00, 'SERCON2007', NULL),
(2008, '2026-06-06', '2026-10-26', NULL, NULL, 54.00, 0.00, 'قرارداد سرویس 9', NULL, NULL, NULL, 'In Progress', NULL, NULL, 36.00, 'SERCON2008', NULL),
(2009, '2026-05-02', '2026-07-21', NULL, NULL, 56.00, 4.00, 'قرارداد سرویس 10', NULL, NULL, NULL, 'On Hold', NULL, NULL, 94.00, 'SERCON2009', NULL),
(2010, '2026-04-11', '2026-10-19', NULL, NULL, 65.00, 4.00, 'قرارداد سرویس 11', NULL, NULL, NULL, 'Complete', NULL, NULL, 26.00, 'SERCON2010', NULL),
(2011, '2026-04-11', '2026-09-30', NULL, NULL, 29.00, 5.00, 'قرارداد سرویس 12', NULL, NULL, NULL, 'Archived', NULL, NULL, 33.00, 'SERCON2011', NULL);

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

--
-- Table structure for table `vtiger_servicecontractscf`
--

CREATE TABLE `vtiger_servicecontractscf` (
  `servicecontractsid` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_service_usageunit`
--

CREATE TABLE `vtiger_service_usageunit` (
  `service_usageunitid` int(11) NOT NULL,
  `service_usageunit` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(11) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT 0,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_service_usageunit`
--

INSERT IGNORE INTO `vtiger_service_usageunit` (`service_usageunitid`, `service_usageunit`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'Hours', 1, 226, 1, NULL),
(2, 'Days', 1, 227, 2, NULL),
(3, 'Incidents', 1, 228, 3, NULL);

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

--
-- Table structure for table `vtiger_service_usageunit_seq`
--

CREATE TABLE `vtiger_service_usageunit_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_service_usageunit_seq`
--

INSERT IGNORE INTO `vtiger_service_usageunit_seq` (`id`) VALUES
(3);

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

--
-- Table structure for table `vtiger_seticketsrel`
--

CREATE TABLE `vtiger_seticketsrel` (
  `crmid` int(19) NOT NULL DEFAULT 0,
  `ticketid` int(19) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_settings_blocks`
--

CREATE TABLE `vtiger_settings_blocks` (
  `blockid` int(19) NOT NULL,
  `label` varchar(250) DEFAULT NULL,
  `sequence` int(19) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_settings_blocks`
--

INSERT IGNORE INTO `vtiger_settings_blocks` (`blockid`, `label`, `sequence`) VALUES
(1, 'LBL_USER_MANAGEMENT', 1),
(4, 'LBL_OTHER_SETTINGS', 10),
(5, 'LBL_MODULE_MANAGER', 2),
(6, 'LBL_INTEGRATION', 8),
(7, 'LBL_AUTOMATION', 3),
(8, 'LBL_CONFIGURATION', 4),
(9, 'LBL_MARKETING_SALES', 5),
(10, 'LBL_INVENTORY', 6),
(11, 'LBL_MY_PREFERENCES', 7),
(12, 'LBL_EXTENSIONS', 9);

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

--
-- Table structure for table `vtiger_settings_blocks_seq`
--

CREATE TABLE `vtiger_settings_blocks_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_settings_blocks_seq`
--

INSERT IGNORE INTO `vtiger_settings_blocks_seq` (`id`) VALUES
(12);

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

--
-- Table structure for table `vtiger_settings_field`
--

CREATE TABLE `vtiger_settings_field` (
  `fieldid` int(19) NOT NULL,
  `blockid` int(19) DEFAULT NULL,
  `name` varchar(250) DEFAULT NULL,
  `iconpath` varchar(300) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `linkto` text DEFAULT NULL,
  `sequence` int(19) DEFAULT NULL,
  `active` int(19) DEFAULT 0,
  `pinned` int(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_settings_field`
--

INSERT IGNORE INTO `vtiger_settings_field` (`fieldid`, `blockid`, `name`, `iconpath`, `description`, `linkto`, `sequence`, `active`, `pinned`) VALUES
(1, 1, 'LBL_USERS', 'ico-users.gif', 'LBL_USER_DESCRIPTION', 'index.php?module=Users&parent=Settings&view=List', 1, 0, 1),
(2, 1, 'LBL_ROLES', 'ico-roles.gif', 'LBL_ROLE_DESCRIPTION', 'index.php?module=Roles&parent=Settings&view=Index', 2, 0, 0),
(3, 1, 'LBL_PROFILES', 'ico-profile.gif', 'LBL_PROFILE_DESCRIPTION', 'index.php?module=Profiles&parent=Settings&view=List', 3, 0, 0),
(4, 1, 'USERGROUPLIST', 'ico-groups.gif', 'LBL_GROUP_DESCRIPTION', 'index.php?module=Groups&parent=Settings&view=List', 5, 0, 0),
(5, 1, 'LBL_SHARING_ACCESS', 'shareaccess.gif', 'LBL_SHARING_ACCESS_DESCRIPTION', 'index.php?module=SharingAccess&parent=Settings&view=Index', 4, 0, 0),
(7, 1, 'LBL_LOGIN_HISTORY_DETAILS', 'set-IcoLoginHistory.gif', 'LBL_LOGIN_HISTORY_DESCRIPTION', 'index.php?module=LoginHistory&parent=Settings&view=List', 6, 0, 0),
(8, 5, 'VTLIB_LBL_MODULE_MANAGER', 'vtlib_modmng.gif', 'VTLIB_LBL_MODULE_MANAGER_DESCRIPTION', 'index.php?module=ModuleManager&parent=Settings&view=List', 1, 0, 1),
(9, 8, 'LBL_PICKLIST_EDITOR', 'picklist.gif', 'LBL_PICKLIST_DESCRIPTION', 'index.php?parent=Settings&module=Picklist&view=Index', 6, 0, 1),
(10, 8, 'LBL_PICKLIST_DEPENDENCY', 'picklistdependency.gif', 'LBL_PICKLIST_DEPENDENCY_DESCRIPTION', 'index.php?parent=Settings&module=PickListDependency&view=List', 7, 0, 0),
(11, 8, 'LBL_MENU_EDITOR', 'menueditor.png', 'LBL_MENU_DESC', 'index.php?module=MenuEditor&parent=Settings&view=Index', 8, 0, 0),
(14, 8, 'LBL_COMPANY_DETAILS', 'company.gif', 'LBL_COMPANY_DESCRIPTION', 'index.php?parent=Settings&module=Vtiger&view=CompanyDetails', 1, 0, 0),
(15, 8, 'LBL_MAIL_SERVER_SETTINGS', 'ogmailserver.gif', 'LBL_MAIL_SERVER_DESCRIPTION', 'index.php?parent=Settings&module=Vtiger&view=OutgoingServerDetail', 4, 0, 0),
(16, 8, 'LBL_CURRENCY_SETTINGS', 'currency.gif', 'LBL_CURRENCY_DESCRIPTION', 'index.php?parent=Settings&module=Currency&view=List', 3, 0, 0),
(17, 10, 'LBL_TAX_SETTINGS', 'taxConfiguration.gif', 'LBL_TAX_DESCRIPTION', 'index.php?module=Vtiger&parent=Settings&view=TaxIndex', 1, 0, 0),
(18, 4, 'LBL_SYSTEM_INFO', 'system.gif', 'LBL_SYSTEM_DESCRIPTION', 'index.php?module=Settings&submodule=Server&view=ProxyConfig', 6, 1, 0),
(20, 4, 'LBL_DEFAULT_MODULE_VIEW', 'set-IcoTwoTabConfig.gif', 'LBL_DEFAULT_MODULE_VIEW_DESC', 'index.php?module=Settings&action=DefModuleView&parenttab=Settings', 2, 0, 0),
(21, 10, 'INVENTORYTERMSANDCONDITIONS', 'terms.gif', 'LBL_INV_TANDC_DESCRIPTION', 'index.php?parent=Settings&module=Vtiger&view=TermsAndConditionsEdit', 2, 0, 0),
(22, 5, 'LBL_CUSTOMIZE_MODENT_NUMBER', 'settingsInvNumber.gif', 'LBL_CUSTOMIZE_MODENT_NUMBER_DESCRIPTION', 'index.php?module=Vtiger&parent=Settings&view=CustomRecordNumbering', 4, 0, 0),
(23, 4, 'LBL_MAIL_SCANNER', 'mailScanner.gif', 'LBL_MAIL_SCANNER_DESCRIPTION', 'index.php?parent=Settings&module=MailConverter&view=List', 5, 0, 0),
(24, 7, 'LBL_LIST_WORKFLOWS', 'settingsWorkflow.png', 'LBL_LIST_WORKFLOWS_DESCRIPTION', 'index.php?module=Workflows&parent=Settings&view=List', 3, 0, 1),
(25, 8, 'Configuration Editor', 'migrate.gif', 'LBL_CONFIG_EDITOR_DESCRIPTION', 'index.php?module=Vtiger&parent=Settings&view=ConfigEditorDetail', 5, 0, 0),
(26, 7, 'Scheduler', 'Cron.png', 'Allows you to Configure Cron Task', 'index.php?module=CronTasks&parent=Settings&view=List', 2, 0, 0),
(28, 4, 'ModTracker', 'set-IcoLoginHistory.gif', 'LBL_MODTRACKER_DESCRIPTION', 'index.php?module=ModTracker&action=BasicSettings&parenttab=Settings&formodule=ModTracker', 9, 0, 0),
(29, 6, 'LBL_PBXMANAGER', '', 'PBXManager module Configuration', 'index.php?module=PBXManager&parent=Settings&view=Index', 2, 0, 0),
(31, 7, 'Webforms', 'modules/Webforms/img/Webform.png', 'LBL_WEBFORMS_DESCRIPTION', 'index.php?module=Webforms&parent=Settings&view=List', 1, 0, 0),
(32, 5, 'LBL_EDIT_FIELDS', '', 'LBL_LAYOUT_EDITOR_DESCRIPTION', 'index.php?module=LayoutEditor&parent=Settings&view=Index', 2, 0, 0),
(33, 9, 'LBL_LEAD_MAPPING', 'NULL', 'NULL', 'index.php?parent=Settings&module=Leads&view=MappingDetail', 1, 0, 1),
(34, 9, 'LBL_OPPORTUNITY_MAPPING', 'NULL', 'NULL', 'index.php?parent=Settings&module=Potentials&view=MappingDetail', 2, 0, 1),
(35, 11, 'My Preferences', 'NULL', 'NULL', 'index.php?module=Users&view=PreferenceDetail&parent=Settings&record=1', 1, 0, 1),
(36, 11, 'Calendar Settings', 'NULL', 'NULL', 'index.php?module=Users&parent=Settings&view=Calendar&record=1', 2, 0, 1),
(37, 11, 'LBL_MY_TAGS', 'NULL', 'NULL', 'index.php?module=Tags&parent=Settings&view=List&record=1', 3, 0, 1),
(38, 12, 'LBL_EXTENSION_STORE', 'NULL', 'NULL', 'index.php?module=ExtensionStore&parent=Settings&view=ExtensionStore', 1, 0, 1),
(39, 12, 'LBL_GOOGLE', 'NULL', 'NULL', 'index.php?module=Contacts&parent=Settings&view=Extension&extensionModule=Google&extensionView=Index&mode=settings', 2, 0, 1),
(40, 6, 'LBL_SMS_GATEWAY_SETTINGS', '', 'LBL_SMS_GATEWAY_SETTINGS_DESC', 'index.php?module=SMSNotifier&parent=Settings&view=List', 3, 0, 1);

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

--
-- Table structure for table `vtiger_settings_field_seq`
--

CREATE TABLE `vtiger_settings_field_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_settings_field_seq`
--

INSERT IGNORE INTO `vtiger_settings_field_seq` (`id`) VALUES
(39);

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

--
-- Table structure for table `vtiger_sharedcalendar`
--

CREATE TABLE `vtiger_sharedcalendar` (
  `userid` int(19) NOT NULL,
  `sharedid` int(19) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_shareduserinfo`
--

CREATE TABLE `vtiger_shareduserinfo` (
  `userid` int(19) NOT NULL DEFAULT 0,
  `shareduserid` int(19) NOT NULL DEFAULT 0,
  `color` varchar(50) DEFAULT NULL,
  `visible` int(19) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_shippingtaxinfo`
--

CREATE TABLE `vtiger_shippingtaxinfo` (
  `taxid` int(3) NOT NULL,
  `taxname` varchar(50) DEFAULT NULL,
  `taxlabel` varchar(50) DEFAULT NULL,
  `percentage` decimal(7,3) DEFAULT NULL,
  `deleted` int(1) DEFAULT NULL,
  `method` varchar(10) DEFAULT NULL,
  `type` varchar(10) DEFAULT NULL,
  `compoundon` varchar(400) DEFAULT NULL,
  `regions` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_shippingtaxinfo`
--

INSERT IGNORE INTO `vtiger_shippingtaxinfo` (`taxid`, `taxname`, `taxlabel`, `percentage`, `deleted`, `method`, `type`, `compoundon`, `regions`) VALUES
(1, 'shtax1', 'VAT', 4.500, 0, 'Simple', 'Fixed', '[]', '[]'),
(2, 'shtax2', 'Sales', 10.000, 0, 'Simple', 'Fixed', '[]', '[]'),
(3, 'shtax3', 'Service', 12.500, 0, 'Simple', 'Fixed', '[]', '[]');

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

--
-- Table structure for table `vtiger_shippingtaxinfo_seq`
--

CREATE TABLE `vtiger_shippingtaxinfo_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_shippingtaxinfo_seq`
--

INSERT IGNORE INTO `vtiger_shippingtaxinfo_seq` (`id`) VALUES
(3);

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

--
-- Table structure for table `vtiger_shorturls`
--

CREATE TABLE `vtiger_shorturls` (
  `id` int(11) NOT NULL,
  `uid` varchar(50) DEFAULT NULL,
  `handler_path` varchar(400) DEFAULT NULL,
  `handler_class` varchar(100) DEFAULT NULL,
  `handler_function` varchar(100) DEFAULT NULL,
  `handler_data` text DEFAULT NULL,
  `onetime` int(5) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_smsnotifier`
--

CREATE TABLE `vtiger_smsnotifier` (
  `smsnotifierid` int(19) NOT NULL,
  `message` text DEFAULT NULL,
  `status` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_smsnotifier`
--

INSERT IGNORE INTO `vtiger_smsnotifier` (`smsnotifierid`, `message`, `status`) VALUES
(3, 'قققق', NULL),
(4, 'لالالا', NULL),
(5, 'سیسیس', NULL),
(6, 'سیسیس', NULL),
(7, 'لبلب', NULL),
(8, 'رذذر', NULL);

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

--
-- Table structure for table `vtiger_smsnotifiercf`
--

CREATE TABLE `vtiger_smsnotifiercf` (
  `smsnotifierid` int(19) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_smsnotifiercf`
--

INSERT IGNORE INTO `vtiger_smsnotifiercf` (`smsnotifierid`) VALUES
(3),
(4),
(5),
(6),
(7),
(8);

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

--
-- Table structure for table `vtiger_smsnotifier_status`
--

CREATE TABLE `vtiger_smsnotifier_status` (
  `smsnotifierid` int(19) DEFAULT NULL,
  `tonumber` varchar(20) DEFAULT NULL,
  `status` varchar(10) DEFAULT NULL,
  `smsmessageid` varchar(50) DEFAULT NULL,
  `needlookup` int(1) DEFAULT 1,
  `statusid` int(11) NOT NULL,
  `statusmessage` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_smsnotifier_status`
--

INSERT IGNORE INTO `vtiger_smsnotifier_status` (`smsnotifierid`, `tonumber`, `status`, `smsmessageid`, `needlookup`, `statusid`, `statusmessage`) VALUES
(3, '09119090378', 'Failed', '', 0, 1, 'پاسخ نامعتبر (HTTP 200)'),
(4, '09119090378', 'Failed', '', 0, 2, 'پاسخ نامعتبر (HTTP 200)'),
(5, '09119090378', 'Failed', '', 0, 3, 'پاسخ نامعتبر (HTTP 200)'),
(6, '09119090378', 'Failed', '', 0, 4, 'پاسخ نامعتبر (HTTP 200)'),
(7, '09119090378', 'Failed', '', 0, 5, 'پاسخ نامعتبر (HTTP 200)'),
(8, '09119090378', 'Dispatched', '25694415', 1, 6, 'پیام با موفقیت ارسال شد');

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

--
-- Table structure for table `vtiger_sms_reminder`
--

CREATE TABLE `vtiger_sms_reminder` (
  `sms_reminderid` int(11) NOT NULL,
  `sms_reminder` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(11) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT 0,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sms_reminder`
--

INSERT IGNORE INTO `vtiger_sms_reminder` (`sms_reminderid`, `sms_reminder`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'None', 1, 376, 1, NULL),
(2, 'OneDayBefore', 1, 377, 2, NULL),
(3, 'TwoDaysBefore', 1, 378, 3, NULL),
(4, 'OneWeekBefore', 1, 379, 4, NULL);

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

--
-- Table structure for table `vtiger_sms_reminder_seq`
--

CREATE TABLE `vtiger_sms_reminder_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `vtiger_sms_reminder_seq`
--

INSERT IGNORE INTO `vtiger_sms_reminder_seq` (`id`) VALUES
(4);

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

--
-- Table structure for table `vtiger_sms_remind_invitees`
--

CREATE TABLE `vtiger_sms_remind_invitees` (
  `sms_remind_inviteesid` int(11) NOT NULL,
  `sms_remind_invitees` varchar(200) NOT NULL,
  `sortorderid` int(11) DEFAULT NULL,
  `presence` int(11) NOT NULL DEFAULT 1,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sms_remind_invitees`
--

INSERT IGNORE INTO `vtiger_sms_remind_invitees` (`sms_remind_inviteesid`, `sms_remind_invitees`, `sortorderid`, `presence`, `color`) VALUES
(1, 'بدون', 0, 1, NULL),
(2, 'یک دقیقه قبل از شروع', 1, 1, NULL),
(3, 'پانزده دقیقه قبل از شروع', 2, 1, NULL),
(4, 'یک ساعت قبل از شروع', 3, 1, NULL),
(5, 'چهار ساعت قبل از شروع', 4, 1, NULL),
(6, 'یک روز قبل از شروع', 5, 1, NULL),
(7, 'دو روز قبل از شروع', 6, 1, NULL);

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

--
-- Table structure for table `vtiger_sms_remind_invitees_seq`
--

CREATE TABLE `vtiger_sms_remind_invitees_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_sms_remind_invitees_seq`
--

INSERT IGNORE INTO `vtiger_sms_remind_invitees_seq` (`id`) VALUES
(7);

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

--
-- Table structure for table `vtiger_sms_remind_user`
--

CREATE TABLE `vtiger_sms_remind_user` (
  `sms_remind_userid` int(11) NOT NULL,
  `sms_remind_user` varchar(200) NOT NULL,
  `sortorderid` int(11) DEFAULT NULL,
  `presence` int(11) NOT NULL DEFAULT 1,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sms_remind_user`
--

INSERT IGNORE INTO `vtiger_sms_remind_user` (`sms_remind_userid`, `sms_remind_user`, `sortorderid`, `presence`, `color`) VALUES
(1, 'بدون', 0, 1, NULL),
(2, 'یک دقیقه قبل از شروع', 1, 1, NULL),
(3, 'پانزده دقیقه قبل از شروع', 2, 1, NULL),
(4, 'یک ساعت قبل از شروع', 3, 1, NULL),
(5, 'چهار ساعت قبل از شروع', 4, 1, NULL),
(6, 'یک روز قبل از شروع', 5, 1, NULL),
(7, 'دو روز قبل از شروع', 6, 1, NULL);

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

--
-- Table structure for table `vtiger_sms_remind_user_seq`
--

CREATE TABLE `vtiger_sms_remind_user_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_sms_remind_user_seq`
--

INSERT IGNORE INTO `vtiger_sms_remind_user_seq` (`id`) VALUES
(7);

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

--
-- Table structure for table `vtiger_sobillads`
--

CREATE TABLE `vtiger_sobillads` (
  `sobilladdressid` int(19) NOT NULL DEFAULT 0,
  `bill_city` varchar(30) DEFAULT NULL,
  `bill_code` varchar(30) DEFAULT NULL,
  `bill_country` varchar(30) DEFAULT NULL,
  `bill_state` varchar(30) DEFAULT NULL,
  `bill_street` varchar(250) DEFAULT NULL,
  `bill_pobox` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_soshipads`
--

CREATE TABLE `vtiger_soshipads` (
  `soshipaddressid` int(19) NOT NULL DEFAULT 0,
  `ship_city` varchar(30) DEFAULT NULL,
  `ship_code` varchar(30) DEFAULT NULL,
  `ship_country` varchar(30) DEFAULT NULL,
  `ship_state` varchar(30) DEFAULT NULL,
  `ship_street` varchar(250) DEFAULT NULL,
  `ship_pobox` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_sostatus`
--

CREATE TABLE `vtiger_sostatus` (
  `sostatusid` int(19) NOT NULL,
  `sostatus` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(19) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT NULL,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_sostatus`
--

INSERT IGNORE INTO `vtiger_sostatus` (`sostatusid`, `sostatus`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'Created', 0, 166, 0, NULL),
(2, 'Approved', 0, 167, 1, NULL),
(3, 'Delivered', 0, 168, 2, NULL),
(4, 'Cancelled', 0, 169, 3, NULL);

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

--
-- Table structure for table `vtiger_sostatushistory`
--

CREATE TABLE `vtiger_sostatushistory` (
  `historyid` int(19) NOT NULL,
  `salesorderid` int(19) NOT NULL,
  `accountname` varchar(100) DEFAULT NULL,
  `total` decimal(10,0) DEFAULT NULL,
  `sostatus` varchar(200) DEFAULT NULL,
  `lastmodified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_sostatus_seq`
--

CREATE TABLE `vtiger_sostatus_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_sostatus_seq`
--

INSERT IGNORE INTO `vtiger_sostatus_seq` (`id`) VALUES
(4);

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

--
-- Table structure for table `vtiger_sqltimelog`
--

CREATE TABLE `vtiger_sqltimelog` (
  `id` int(11) DEFAULT NULL,
  `type` varchar(10) DEFAULT NULL,
  `data` text DEFAULT NULL,
  `started` decimal(20,6) DEFAULT NULL,
  `ended` decimal(20,6) DEFAULT NULL,
  `loggedon` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `vtiger_start_hour`
--

CREATE TABLE `vtiger_start_hour` (
  `start_hourid` int(11) NOT NULL,
  `start_hour` varchar(200) NOT NULL,
  `sortorderid` int(11) DEFAULT NULL,
  `presence` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_start_hour`
--

INSERT IGNORE INTO `vtiger_start_hour` (`start_hourid`, `start_hour`, `sortorderid`, `presence`) VALUES
(1, '00:00', 0, 1),
(2, '01:00', 1, 1),
(3, '02:00', 2, 1),
(4, '03:00', 3, 1),
(5, '04:00', 4, 1),
(6, '05:00', 5, 1),
(7, '06:00', 6, 1),
(8, '07:00', 7, 1),
(9, '08:00', 8, 1),
(10, '09:00', 9, 1),
(11, '10:00', 10, 1),
(12, '11:00', 11, 1),
(13, '12:00', 12, 1),
(14, '13:00', 13, 1),
(15, '14:00', 14, 1),
(16, '15:00', 15, 1),
(17, '16:00', 16, 1),
(18, '17:00', 17, 1),
(19, '18:00', 18, 1),
(20, '19:00', 19, 1),
(21, '20:00', 20, 1),
(22, '21:00', 21, 1),
(23, '22:00', 22, 1),
(24, '23:00', 23, 1);

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

--
-- Table structure for table `vtiger_start_hour_seq`
--

CREATE TABLE `vtiger_start_hour_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_start_hour_seq`
--

INSERT IGNORE INTO `vtiger_start_hour_seq` (`id`) VALUES
(24);

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

--
-- Table structure for table `vtiger_status`
--

CREATE TABLE `vtiger_status` (
  `statusid` int(19) NOT NULL,
  `status` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(19) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_status`
--

INSERT IGNORE INTO `vtiger_status` (`statusid`, `status`, `presence`, `picklist_valueid`) VALUES
(1, 'Active', 0, 1),
(2, 'Inactive', 1, 1);

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

--
-- Table structure for table `vtiger_status_seq`
--

CREATE TABLE `vtiger_status_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_status_seq`
--

INSERT IGNORE INTO `vtiger_status_seq` (`id`) VALUES
(2);

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

--
-- Table structure for table `vtiger_tab`
--

CREATE TABLE `vtiger_tab` (
  `tabid` int(19) NOT NULL DEFAULT 0,
  `name` varchar(25) NOT NULL,
  `presence` int(19) NOT NULL DEFAULT 1,
  `tabsequence` int(10) DEFAULT NULL,
  `tablabel` varchar(100) DEFAULT NULL,
  `modifiedby` int(19) DEFAULT NULL,
  `modifiedtime` int(19) DEFAULT NULL,
  `customized` int(19) DEFAULT NULL,
  `ownedby` int(19) DEFAULT NULL,
  `isentitytype` int(11) NOT NULL DEFAULT 1,
  `trial` int(1) NOT NULL DEFAULT 0,
  `version` varchar(10) DEFAULT NULL,
  `parent` varchar(30) DEFAULT NULL,
  `source` varchar(255) DEFAULT 'custom',
  `issyncable` tinyint(1) DEFAULT 0,
  `allowduplicates` tinyint(1) DEFAULT 1,
  `sync_action_for_duplicates` int(1) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_tab`
--

INSERT IGNORE INTO `vtiger_tab` (`tabid`, `name`, `presence`, `tabsequence`, `tablabel`, `modifiedby`, `modifiedtime`, `customized`, `ownedby`, `isentitytype`, `trial`, `version`, `parent`, `source`, `issyncable`, `allowduplicates`, `sync_action_for_duplicates`) VALUES
(1, 'Dashboard', 0, 12, 'Dashboards', NULL, NULL, 0, 1, 0, 0, NULL, 'Analytics', NULL, 1, 1, 1),
(2, 'Potentials', 0, 7, 'Potentials', NULL, NULL, 0, 0, 1, 0, NULL, 'Sales', NULL, 1, 1, 1),
(3, 'Home', 0, 1, 'Home', NULL, NULL, 0, 1, 0, 0, NULL, NULL, NULL, 1, 1, 1),
(4, 'Contacts', 0, 6, 'Contacts', NULL, NULL, 0, 0, 1, 0, NULL, 'Sales', NULL, 1, 1, 1),
(6, 'Accounts', 0, 5, 'Accounts', NULL, NULL, 0, 0, 1, 0, NULL, 'Sales', NULL, 1, 0, 1),
(7, 'Leads', 0, 4, 'Leads', NULL, NULL, 0, 0, 1, 0, NULL, 'Sales', NULL, 1, 1, 1),
(8, 'Documents', 0, 9, 'Documents', NULL, NULL, 0, 0, 1, 0, NULL, 'Tools', NULL, 1, 1, 1),
(9, 'Calendar', 0, 3, 'Calendar', NULL, NULL, 0, 0, 1, 0, NULL, 'Tools', NULL, 1, 1, 1),
(10, 'Emails', 0, 10, 'Emails', NULL, NULL, 0, 0, 1, 0, NULL, 'Tools', NULL, 1, 1, 1),
(13, 'HelpDesk', 0, 11, 'HelpDesk', NULL, NULL, 0, 0, 1, 0, NULL, 'Support', NULL, 1, 1, 1),
(14, 'Products', 0, 8, 'Products', NULL, NULL, 0, 0, 1, 0, NULL, 'Inventory', NULL, 1, 1, 1),
(15, 'Faq', 0, -1, 'Faq', NULL, NULL, 0, 1, 1, 0, NULL, 'Support', NULL, 1, 1, 1),
(16, 'Events', 2, -1, 'Events', NULL, NULL, 0, 0, 1, 0, NULL, NULL, NULL, 1, 1, 1),
(18, 'Vendors', 0, -1, 'Vendors', NULL, NULL, 0, 0, 1, 0, NULL, 'Inventory', NULL, 1, 1, 1),
(19, 'PriceBooks', 0, -1, 'PriceBooks', NULL, NULL, 0, 1, 1, 0, NULL, 'Inventory', NULL, 1, 1, 1),
(20, 'Quotes', 0, -1, 'Quotes', NULL, NULL, 0, 0, 1, 0, NULL, 'Sales', NULL, 1, 1, 1),
(21, 'PurchaseOrder', 0, -1, 'PurchaseOrder', NULL, NULL, 0, 0, 1, 0, NULL, 'Inventory', NULL, 1, 1, 1),
(22, 'SalesOrder', 0, -1, 'SalesOrder', NULL, NULL, 0, 0, 1, 0, NULL, 'Sales', NULL, 1, 1, 1),
(23, 'Invoice', 0, -1, 'Invoice', NULL, NULL, 0, 0, 1, 0, NULL, 'Sales', NULL, 1, 1, 1),
(24, 'Rss', 0, -1, 'Rss', NULL, NULL, 0, 1, 0, 0, NULL, 'Tools', NULL, 1, 1, 1),
(25, 'Reports', 0, -1, 'Reports', NULL, NULL, 0, 1, 0, 0, NULL, 'Analytics', NULL, 1, 1, 1),
(26, 'Campaigns', 0, -1, 'Campaigns', NULL, NULL, 0, 0, 1, 0, NULL, 'Marketing', NULL, 1, 1, 1),
(27, 'Portal', 0, -1, 'Portal', NULL, NULL, 0, 1, 0, 0, NULL, 'Tools', NULL, 1, 1, 1),
(28, 'Webmails', 0, -1, 'Webmails', NULL, NULL, 0, 1, 1, 0, NULL, NULL, NULL, 1, 1, 1),
(29, 'Users', 0, -1, 'Users', NULL, NULL, 0, 1, 0, 0, NULL, NULL, NULL, 1, 1, 1),
(30, 'Import', 0, -1, 'Import', NULL, NULL, 1, 0, 0, 0, '1.7', '', NULL, 1, 1, 1),
(31, 'MailManager', 0, -1, 'MailManager', NULL, NULL, 1, 0, 0, 0, '1.9', 'Tools', NULL, 1, 1, 1),
(32, 'Mobile', 0, -1, 'Mobile', NULL, NULL, 1, 0, 0, 0, '2.0', '', NULL, 1, 1, 1),
(33, 'ModTracker', 0, -1, 'ModTracker', NULL, NULL, 0, 0, 0, 0, '1.2', '', NULL, 1, 1, 1),
(34, 'PBXManager', 0, -1, 'PBXManager', NULL, NULL, 1, 0, 1, 0, '2.2', 'Tools', NULL, 1, 1, 1),
(35, 'ServiceContracts', 0, -1, 'Service Contracts', NULL, NULL, 0, 0, 1, 0, '2.4', 'Support', NULL, 1, 1, 1),
(36, 'Services', 0, -1, 'Services', NULL, NULL, 0, 0, 1, 0, '2.7', 'Inventory', NULL, 1, 1, 1),
(37, 'WSAPP', 0, -1, 'WSAPP', NULL, NULL, 1, 0, 0, 0, '3.4.4', '', NULL, 1, 1, 1),
(38, 'Assets', 0, -1, 'Assets', NULL, NULL, 0, 0, 1, 0, '2.0', 'Inventory', NULL, 1, 1, 1),
(39, 'CustomerPortal', 1, -1, 'CustomerPortal', NULL, NULL, 0, 0, 0, 0, '1.4', '', NULL, 1, 1, 1),
(40, 'EmailTemplates', 0, -1, 'Email Templates', NULL, NULL, 1, 0, 0, 0, '1.0', 'Tools', NULL, 1, 1, 1),
(41, 'Google', 0, -1, 'Google', NULL, NULL, 0, 0, 0, 0, '1.5', '', NULL, 1, 1, 1),
(42, 'ModComments', 0, -1, 'Comments', NULL, NULL, 0, 0, 1, 0, '2.1', '', NULL, 1, 1, 1),
(43, 'ProjectMilestone', 0, -1, 'ProjectMilestone', NULL, NULL, 0, 0, 1, 0, '3.0', 'Support', NULL, 1, 1, 1),
(44, 'ProjectTask', 0, -1, 'ProjectTask', NULL, NULL, 0, 0, 1, 0, '3.1', 'Support', NULL, 1, 1, 1),
(45, 'Project', 0, -1, 'Project', NULL, NULL, 0, 0, 1, 0, '3.3', 'Support', NULL, 1, 1, 1),
(46, 'RecycleBin', 0, -1, 'Recycle Bin', NULL, NULL, 0, 0, 0, 0, '1.5', 'Tools', NULL, 1, 1, 1),
(47, 'SMSNotifier', 0, -1, 'SMSNotifier', NULL, NULL, 0, 0, 1, 0, '2.1', 'Sales', NULL, 1, 1, 1),
(48, 'Webforms', 0, -1, 'Webforms', NULL, NULL, 0, 0, 0, 0, '1.7', '', NULL, 1, 1, 1),
(49, 'ExtensionStore', 0, -1, 'Extension Store', NULL, NULL, 1, 0, 0, 0, '1.2', NULL, NULL, 1, 1, 1),
(50, 'GooyaReports', 0, -1, 'GooyaReports', NULL, NULL, 1, 0, 0, 0, '0', 'Tools', 'custom', 0, 1, 1),
(51, 'GooyaKanban', 0, -1, 'GooyaKanban', NULL, NULL, 1, 0, 0, 0, '0', 'Tools', 'custom', 0, 1, 1),
(52, 'SarvPayments', 0, -1, 'LBL_SARV_PAYMENTS', NULL, NULL, 1, 0, 1, 0, '0', 'Sales', 'custom', 0, 1, 1),
(53, 'SarvParticipations', 0, -1, 'LBL_SARV_PARTICIPATIONS', NULL, NULL, 1, 0, 1, 0, '0', 'Sales', 'custom', 0, 1, 1),
(54, 'SarvSurveyResponses', 0, -1, 'LBL_SARV_SURVEY_RESPONSES', NULL, NULL, 1, 0, 1, 0, '0', 'Sales', 'custom', 0, 1, 1),
(55, 'SarvSalesContracts', 0, -1, 'LBL_SARV_SALES_CONTRACTS', NULL, NULL, 1, 0, 1, 0, '0', 'Sales', 'custom', 0, 1, 1),
(56, 'SarvTargetLists', 0, -1, 'LBL_SARV_TARGET_LISTS', NULL, NULL, 1, 0, 1, 0, '0', 'Sales', 'custom', 0, 1, 1),
(57, 'SarvBankAccounts', 0, -1, 'LBL_SARV_BANK_ACCOUNTS', NULL, NULL, 1, 0, 1, 0, '0', 'Sales', 'custom', 0, 1, 1),
(58, 'SarvDeposits', 0, -1, 'LBL_SARV_DEPOSITS', NULL, NULL, 1, 0, 1, 0, '0', 'Sales', 'custom', 0, 1, 1),
(59, 'SarvBusinessLocations', 0, -1, 'LBL_SARV_BUSINESS_LOCATIONS', NULL, NULL, 1, 0, 1, 0, '0', 'Sales', 'custom', 0, 1, 1),
(60, 'SarvTimeReservations', 0, -1, 'LBL_SARV_TIME_RESERVATIONS', NULL, NULL, 1, 0, 1, 0, '0', 'Sales', 'custom', 0, 1, 1),
(61, 'SarvGifts', 0, -1, 'LBL_SARV_GIFTS', NULL, NULL, 1, 0, 1, 0, '0', 'Sales', 'custom', 0, 1, 1),
(62, 'SarvProductSamples', 0, -1, 'LBL_SARV_PRODUCT_SAMPLES', NULL, NULL, 1, 0, 1, 0, '0', 'Sales', 'custom', 0, 1, 1),
(63, 'SarvAccessGrants', 0, -1, 'LBL_SARV_ACCESS_GRANTS', NULL, NULL, 1, 0, 1, 0, '0', 'Sales', 'custom', 0, 1, 1),
(64, 'Administration', 0, -1, 'مدیر سیستم', NULL, NULL, 1, 0, 0, 0, '0', '', 'custom', 0, 1, 1),
(65, 'Communications', 0, -1, 'Communications', NULL, NULL, 1, 0, 1, 0, '0', 'Marketing', 'custom', 0, 1, 1),
(66, 'GooyaCloud', 0, -1, 'GooyaCloud', NULL, NULL, 1, 0, 0, 0, '2.0', 'Tools', 'custom', 0, 1, 1),
(67, 'GooyaChat', 1, -1, 'GooyaChat', NULL, NULL, 1, 0, 0, 0, '2.0', 'Tools', 'custom', 0, 1, 1),
(68, 'GooyaNegar', 0, -1, 'GooyaNegar', NULL, NULL, 1, 0, 0, 0, '1.0', 'Tools', 'custom', 0, 1, 1);

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

--
-- Table structure for table `vtiger_tab_info`
--

CREATE TABLE `vtiger_tab_info` (
  `tabid` int(19) DEFAULT NULL,
  `prefname` varchar(256) DEFAULT NULL,
  `prefvalue` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_tab_info`
--

INSERT IGNORE INTO `vtiger_tab_info` (`tabid`, `prefname`, `prefvalue`) VALUES
(30, 'vtiger_min_version', '6.0.0rc'),
(30, 'vtiger_max_version', '8.*'),
(31, 'vtiger_min_version', '6.0.0RC'),
(32, 'vtiger_min_version', '6.0.0rc'),
(33, 'vtiger_min_version', '6.0.0rc'),
(34, 'vtiger_min_version', '6.0.0'),
(34, 'vtiger_max_version', '8.*'),
(35, 'vtiger_min_version', '6.0.0rc'),
(36, 'vtiger_min_version', '6.0.0rc'),
(36, 'vtiger_max_version', '8.*'),
(37, 'vtiger_min_version', '6.0.0rc'),
(38, 'vtiger_min_version', '6.0.0rc'),
(38, 'vtiger_max_version', '8.*'),
(39, 'vtiger_min_version', '6.0.0rc'),
(39, 'vtiger_max_version', '8.*'),
(40, 'vtiger_min_version', '6.0.0rc'),
(40, 'vtiger_max_version', '8.*'),
(41, 'vtiger_min_version', '6.0.0rc'),
(41, 'vtiger_max_version', '8.*'),
(42, 'vtiger_min_version', '6.0.0rc'),
(42, 'vtiger_max_version', '8.*'),
(43, 'vtiger_min_version', '6.0.0rc'),
(43, 'vtiger_max_version', '8.*'),
(44, 'vtiger_min_version', '6.0.0rc'),
(45, 'vtiger_min_version', '6.0.0rc'),
(46, 'vtiger_min_version', '6.0.0rc'),
(46, 'vtiger_max_version', '8.*'),
(47, 'vtiger_min_version', '6.0.0'),
(47, 'vtiger_max_version', '8.*'),
(48, 'vtiger_min_version', '6.0.0rc'),
(48, 'vtiger_max_version', '8.*'),
(49, 'vtiger_min_version', '6.0.0'),
(49, 'vtiger_max_version', '8.*');

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

--
-- Table structure for table `vtiger_taskpriority`
--

CREATE TABLE `vtiger_taskpriority` (
  `taskpriorityid` int(19) NOT NULL,
  `taskpriority` varchar(200) DEFAULT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(19) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT NULL,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_taskpriority`
--

INSERT IGNORE INTO `vtiger_taskpriority` (`taskpriorityid`, `taskpriority`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'High', 1, 170, 0, NULL),
(2, 'Medium', 1, 171, 1, NULL),
(3, 'Low', 1, 172, 2, NULL);

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

--
-- Table structure for table `vtiger_taskpriority_seq`
--

CREATE TABLE `vtiger_taskpriority_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_taskpriority_seq`
--

INSERT IGNORE INTO `vtiger_taskpriority_seq` (`id`) VALUES
(3);

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

--
-- Table structure for table `vtiger_taskstatus`
--

CREATE TABLE `vtiger_taskstatus` (
  `taskstatusid` int(19) NOT NULL,
  `taskstatus` varchar(200) DEFAULT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(19) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT NULL,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_taskstatus`
--

INSERT IGNORE INTO `vtiger_taskstatus` (`taskstatusid`, `taskstatus`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'Not Started', 0, 173, 0, NULL),
(2, 'In Progress', 0, 174, 1, NULL),
(3, 'Completed', 0, 175, 2, NULL),
(4, 'Pending Input', 0, 176, 3, NULL),
(5, 'Deferred', 0, 177, 4, NULL),
(6, 'Planned', 0, 178, 5, NULL);

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

--
-- Table structure for table `vtiger_taskstatus_seq`
--

CREATE TABLE `vtiger_taskstatus_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_taskstatus_seq`
--

INSERT IGNORE INTO `vtiger_taskstatus_seq` (`id`) VALUES
(6);

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

--
-- Table structure for table `vtiger_taxclass`
--

CREATE TABLE `vtiger_taxclass` (
  `taxclassid` int(19) NOT NULL,
  `taxclass` varchar(200) NOT NULL,
  `sortorderid` int(19) NOT NULL DEFAULT 0,
  `presence` int(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_taxclass`
--

INSERT IGNORE INTO `vtiger_taxclass` (`taxclassid`, `taxclass`, `sortorderid`, `presence`) VALUES
(1, 'SalesTax', 0, 1),
(2, 'Vat', 1, 1);

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

--
-- Table structure for table `vtiger_taxclass_seq`
--

CREATE TABLE `vtiger_taxclass_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_taxclass_seq`
--

INSERT IGNORE INTO `vtiger_taxclass_seq` (`id`) VALUES
(2);

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

--
-- Table structure for table `vtiger_taxregions`
--

CREATE TABLE `vtiger_taxregions` (
  `regionid` int(10) NOT NULL,
  `name` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `vtiger_ticketcategories`
--

CREATE TABLE `vtiger_ticketcategories` (
  `ticketcategories_id` int(19) NOT NULL,
  `ticketcategories` varchar(200) DEFAULT NULL,
  `presence` int(1) NOT NULL DEFAULT 0,
  `picklist_valueid` int(19) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT NULL,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_ticketcategories`
--

INSERT IGNORE INTO `vtiger_ticketcategories` (`ticketcategories_id`, `ticketcategories`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'Big Problem', 1, 179, 0, NULL),
(2, 'Small Problem', 1, 180, 1, NULL),
(3, 'Other Problem', 1, 181, 2, NULL);

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

--
-- Table structure for table `vtiger_ticketcategories_seq`
--

CREATE TABLE `vtiger_ticketcategories_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_ticketcategories_seq`
--

INSERT IGNORE INTO `vtiger_ticketcategories_seq` (`id`) VALUES
(3);

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

--
-- Table structure for table `vtiger_ticketcf`
--

CREATE TABLE `vtiger_ticketcf` (
  `ticketid` int(19) NOT NULL DEFAULT 0,
  `from_portal` varchar(3) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_ticketcf`
--

INSERT IGNORE INTO `vtiger_ticketcf` (`ticketid`, `from_portal`) VALUES
(2092, '0'),
(2094, '0'),
(2097, '0'),
(2099, '0'),
(2101, '0'),
(2104, '0'),
(2106, '0'),
(2109, '0'),
(2149, '0');

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

--
-- Table structure for table `vtiger_ticketcomments`
--

CREATE TABLE `vtiger_ticketcomments` (
  `commentid` int(19) NOT NULL,
  `ticketid` int(19) DEFAULT NULL,
  `comments` text DEFAULT NULL,
  `ownerid` int(19) NOT NULL DEFAULT 0,
  `ownertype` varchar(10) DEFAULT NULL,
  `createdtime` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_ticketpriorities`
--

CREATE TABLE `vtiger_ticketpriorities` (
  `ticketpriorities_id` int(19) NOT NULL,
  `ticketpriorities` varchar(200) DEFAULT NULL,
  `presence` int(1) NOT NULL DEFAULT 0,
  `picklist_valueid` int(19) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT NULL,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_ticketpriorities`
--

INSERT IGNORE INTO `vtiger_ticketpriorities` (`ticketpriorities_id`, `ticketpriorities`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'Low', 1, 182, 0, NULL),
(2, 'Normal', 1, 183, 1, NULL),
(3, 'High', 1, 184, 2, NULL),
(4, 'Urgent', 1, 185, 3, NULL);

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

--
-- Table structure for table `vtiger_ticketpriorities_seq`
--

CREATE TABLE `vtiger_ticketpriorities_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_ticketpriorities_seq`
--

INSERT IGNORE INTO `vtiger_ticketpriorities_seq` (`id`) VALUES
(4);

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

--
-- Table structure for table `vtiger_ticketseverities`
--

CREATE TABLE `vtiger_ticketseverities` (
  `ticketseverities_id` int(19) NOT NULL,
  `ticketseverities` varchar(200) DEFAULT NULL,
  `presence` int(1) NOT NULL DEFAULT 0,
  `picklist_valueid` int(19) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT NULL,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_ticketseverities`
--

INSERT IGNORE INTO `vtiger_ticketseverities` (`ticketseverities_id`, `ticketseverities`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'Minor', 1, 186, 0, NULL),
(2, 'Major', 1, 187, 1, NULL),
(3, 'Feature', 1, 188, 2, NULL),
(4, 'Critical', 1, 189, 3, NULL);

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

--
-- Table structure for table `vtiger_ticketseverities_seq`
--

CREATE TABLE `vtiger_ticketseverities_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_ticketseverities_seq`
--

INSERT IGNORE INTO `vtiger_ticketseverities_seq` (`id`) VALUES
(4);

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

--
-- Table structure for table `vtiger_ticketstatus`
--

CREATE TABLE `vtiger_ticketstatus` (
  `ticketstatus_id` int(19) NOT NULL,
  `ticketstatus` varchar(200) DEFAULT NULL,
  `presence` int(1) NOT NULL DEFAULT 0,
  `picklist_valueid` int(19) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT NULL,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_ticketstatus`
--

INSERT IGNORE INTO `vtiger_ticketstatus` (`ticketstatus_id`, `ticketstatus`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'Open', 0, 190, 0, NULL),
(2, 'In Progress', 0, 191, 1, NULL),
(3, 'Wait For Response', 0, 192, 2, NULL),
(4, 'Closed', 0, 193, 3, NULL);

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

--
-- Table structure for table `vtiger_ticketstatus_seq`
--

CREATE TABLE `vtiger_ticketstatus_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_ticketstatus_seq`
--

INSERT IGNORE INTO `vtiger_ticketstatus_seq` (`id`) VALUES
(4);

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

--
-- Table structure for table `vtiger_time_zone`
--

CREATE TABLE `vtiger_time_zone` (
  `time_zoneid` int(19) NOT NULL,
  `time_zone` varchar(200) NOT NULL,
  `sortorderid` int(19) NOT NULL DEFAULT 0,
  `presence` int(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_time_zone`
--

INSERT IGNORE INTO `vtiger_time_zone` (`time_zoneid`, `time_zone`, `sortorderid`, `presence`) VALUES
(1, 'Pacific/Midway', 1, 1),
(2, 'Pacific/Samoa', 0, 1),
(3, 'Pacific/Honolulu', 2, 1),
(4, 'America/Anchorage', 3, 1),
(5, 'America/Los_Angeles', 5, 1),
(6, 'America/Tijuana', 4, 1),
(7, 'America/Denver', 6, 1),
(8, 'America/Chihuahua', 8, 1),
(9, 'America/Mazatlan', 7, 1),
(10, 'America/Phoenix', 9, 1),
(11, 'America/Regina', 10, 1),
(12, 'America/Tegucigalpa', 14, 1),
(13, 'America/Chicago', 13, 1),
(14, 'America/Mexico_City', 12, 1),
(15, 'America/Monterrey', 11, 1),
(16, 'America/New_York', 18, 1),
(17, 'America/Bogota', 19, 1),
(18, 'America/Lima', 16, 1),
(19, 'America/Rio_Branco', 15, 1),
(20, 'America/Indiana/Indianapolis', 17, 1),
(21, 'America/Caracas', 20, 1),
(22, 'America/Halifax', 25, 1),
(23, 'America/Manaus', 22, 1),
(24, 'America/Santiago', 21, 1),
(25, 'America/La_Paz', 23, 1),
(26, 'America/Cuiaba', 24, 1),
(27, 'America/Asuncion', 26, 1),
(28, 'America/St_Johns', 27, 1),
(29, 'America/Argentina/Buenos_Aires', 30, 1),
(30, 'America/Sao_Paulo', 31, 1),
(31, 'America/Godthab', 29, 1),
(32, 'America/Montevideo', 28, 1),
(33, 'Atlantic/South_Georgia', 32, 1),
(34, 'Atlantic/Azores', 34, 1),
(35, 'Atlantic/Cape_Verde', 33, 1),
(36, 'Europe/London', 37, 1),
(37, 'UTC', 36, 1),
(38, 'Africa/Monrovia', 38, 1),
(39, 'Africa/Casablanca', 35, 1),
(40, 'Europe/Belgrade', 40, 1),
(41, 'Europe/Sarajevo', 42, 1),
(42, 'Europe/Brussels', 41, 1),
(43, 'Africa/Algiers', 43, 1),
(44, 'Europe/Amsterdam', 39, 1),
(45, 'Europe/Minsk', 52, 1),
(46, 'Africa/Cairo', 47, 1),
(47, 'Europe/Helsinki', 49, 1),
(48, 'Europe/Athens', 45, 1),
(49, 'Europe/Istanbul', 50, 1),
(50, 'Asia/Jerusalem', 51, 1),
(51, 'Asia/Amman', 44, 1),
(52, 'Asia/Beirut', 46, 1),
(53, 'Africa/Windhoek', 53, 1),
(54, 'Africa/Harare', 48, 1),
(55, 'Asia/Kuwait', 55, 1),
(56, 'Asia/Baghdad', 54, 1),
(57, 'Africa/Nairobi', 57, 1),
(58, 'Asia/Tehran', 58, 1),
(59, 'Asia/Tbilisi', 61, 1),
(60, 'Europe/Moscow', 56, 1),
(61, 'Asia/Muscat', 59, 1),
(62, 'Asia/Baku', 60, 1),
(63, 'Asia/Yerevan', 62, 1),
(64, 'Asia/Karachi', 63, 1),
(65, 'Asia/Tashkent', 64, 1),
(66, 'Asia/Kolkata', 65, 1),
(67, 'Asia/Colombo', 66, 1),
(68, 'Asia/Katmandu', 67, 1),
(69, 'Asia/Dhaka', 69, 1),
(70, 'Asia/Almaty', 68, 1),
(71, 'Asia/Yekaterinburg', 70, 1),
(72, 'Asia/Rangoon', 71, 1),
(73, 'Asia/Novosibirsk', 73, 1),
(74, 'Asia/Bangkok', 72, 1),
(75, 'Asia/Brunei', 74, 1),
(76, 'Asia/Krasnoyarsk', 75, 1),
(77, 'Asia/Ulaanbaatar', 79, 1),
(78, 'Asia/Kuala_Lumpur', 76, 1),
(79, 'Asia/Taipei', 78, 1),
(80, 'Australia/Perth', 77, 1),
(81, 'Asia/Irkutsk', 80, 1),
(82, 'Asia/Seoul', 81, 1),
(83, 'Asia/Tokyo', 82, 1),
(84, 'Australia/Darwin', 84, 1),
(85, 'Australia/Adelaide', 83, 1),
(86, 'Australia/Canberra', 86, 1),
(87, 'Australia/Brisbane', 85, 1),
(88, 'Australia/Hobart', 88, 1),
(89, 'Asia/Vladivostok', 89, 1),
(90, 'Pacific/Guam', 87, 1),
(91, 'Asia/Yakutsk', 90, 1),
(92, 'Pacific/Fiji', 93, 1),
(93, 'Asia/Kamchatka', 94, 1),
(94, 'Pacific/Auckland', 92, 1),
(95, 'Asia/Magadan', 95, 1),
(96, 'Pacific/Tongatapu', 96, 1),
(97, 'Etc/GMT-11', 91, 1);

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

--
-- Table structure for table `vtiger_time_zone_seq`
--

CREATE TABLE `vtiger_time_zone_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_time_zone_seq`
--

INSERT IGNORE INTO `vtiger_time_zone_seq` (`id`) VALUES
(96);

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

--
-- Table structure for table `vtiger_tmp_read_group_rel_sharing_per`
--

CREATE TABLE `vtiger_tmp_read_group_rel_sharing_per` (
  `userid` int(11) NOT NULL,
  `tabid` int(11) NOT NULL,
  `relatedtabid` int(11) NOT NULL,
  `sharedgroupid` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_tmp_read_group_sharing_per`
--

CREATE TABLE `vtiger_tmp_read_group_sharing_per` (
  `userid` int(11) NOT NULL,
  `tabid` int(11) NOT NULL,
  `sharedgroupid` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_tmp_read_user_rel_sharing_per`
--

CREATE TABLE `vtiger_tmp_read_user_rel_sharing_per` (
  `userid` int(11) NOT NULL,
  `tabid` int(11) NOT NULL,
  `relatedtabid` int(11) NOT NULL,
  `shareduserid` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_tmp_read_user_sharing_per`
--

CREATE TABLE `vtiger_tmp_read_user_sharing_per` (
  `userid` int(11) NOT NULL,
  `tabid` int(11) NOT NULL,
  `shareduserid` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_tmp_write_group_rel_sharing_per`
--

CREATE TABLE `vtiger_tmp_write_group_rel_sharing_per` (
  `userid` int(11) NOT NULL,
  `tabid` int(11) NOT NULL,
  `relatedtabid` int(11) NOT NULL,
  `sharedgroupid` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_tmp_write_group_sharing_per`
--

CREATE TABLE `vtiger_tmp_write_group_sharing_per` (
  `userid` int(11) NOT NULL,
  `tabid` int(11) NOT NULL,
  `sharedgroupid` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_tmp_write_user_rel_sharing_per`
--

CREATE TABLE `vtiger_tmp_write_user_rel_sharing_per` (
  `userid` int(11) NOT NULL,
  `tabid` int(11) NOT NULL,
  `relatedtabid` int(11) NOT NULL,
  `shareduserid` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_tmp_write_user_sharing_per`
--

CREATE TABLE `vtiger_tmp_write_user_sharing_per` (
  `userid` int(11) NOT NULL,
  `tabid` int(11) NOT NULL,
  `shareduserid` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_tracker`
--

CREATE TABLE `vtiger_tracker` (
  `id` int(11) NOT NULL,
  `user_id` varchar(36) DEFAULT NULL,
  `module_name` varchar(25) DEFAULT NULL,
  `item_id` varchar(36) DEFAULT NULL,
  `item_summary` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_tracker`
--

INSERT IGNORE INTO `vtiger_tracker` (`id`, `user_id`, `module_name`, `item_id`, `item_summary`) VALUES
(5, '1', 'Contacts', '2123', 'آقای منوچهر انصاری (مثال)'),
(7, '1', 'Communications', '2289', 'ارتباط عملی طرح گویا ۱۴۰۵/۰۵/۱۱'),
(17, '1', 'Users', '1', 'حسین فغان پور'),
(18, '1', 'Users', '24', 'آرش فلاحی'),
(19, '1', 'Contacts', '2286', 'آزمایش نمونه عملی طرح گویا');

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

--
-- Table structure for table `vtiger_tracking_unit`
--

CREATE TABLE `vtiger_tracking_unit` (
  `tracking_unitid` int(11) NOT NULL,
  `tracking_unit` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(11) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT 0,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_tracking_unit`
--

INSERT IGNORE INTO `vtiger_tracking_unit` (`tracking_unitid`, `tracking_unit`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(2, 'Hours', 1, 211, 2, NULL),
(3, 'Days', 1, 212, 3, NULL),
(4, 'Incidents', 1, 213, 4, NULL);

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

--
-- Table structure for table `vtiger_tracking_unit_seq`
--

CREATE TABLE `vtiger_tracking_unit_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_tracking_unit_seq`
--

INSERT IGNORE INTO `vtiger_tracking_unit_seq` (`id`) VALUES
(4);

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

--
-- Table structure for table `vtiger_troubletickets`
--

CREATE TABLE `vtiger_troubletickets` (
  `ticketid` int(19) NOT NULL,
  `ticket_no` varchar(100) NOT NULL,
  `groupname` varchar(100) DEFAULT NULL,
  `parent_id` varchar(100) DEFAULT NULL,
  `product_id` varchar(100) DEFAULT NULL,
  `priority` varchar(200) DEFAULT NULL,
  `severity` varchar(200) DEFAULT NULL,
  `status` varchar(200) DEFAULT NULL,
  `category` varchar(200) DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `solution` text DEFAULT NULL,
  `update_log` text DEFAULT NULL,
  `version_id` int(11) DEFAULT NULL,
  `hours` decimal(25,8) DEFAULT NULL,
  `days` decimal(25,8) DEFAULT NULL,
  `contact_id` int(19) DEFAULT NULL,
  `tags` varchar(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_troubletickets`
--

INSERT IGNORE INTO `vtiger_troubletickets` (`ticketid`, `ticket_no`, `groupname`, `parent_id`, `product_id`, `priority`, `severity`, `status`, `category`, `title`, `solution`, `update_log`, `version_id`, `hours`, `days`, `contact_id`, `tags`) VALUES
(2092, 'TT1', NULL, '20', '0', 'High', NULL, 'Open', NULL, 'درخواست پشتیبانی نصب (مثال)', '', NULL, NULL, 0.00000000, 0.00000000, 0, ''),
(2094, 'TT2', NULL, '21', '0', 'Urgent', NULL, 'In Progress', NULL, 'مشکل ورود به سامانه (مثال)', '', NULL, NULL, 0.00000000, 0.00000000, 0, ''),
(2097, 'TT3', NULL, '22', '0', 'Normal', NULL, 'Wait For Response', NULL, 'درخواست آموزش کاربری (مثال)', '', NULL, NULL, 0.00000000, 0.00000000, 0, ''),
(2099, 'TT4', NULL, '23', '0', 'Normal', NULL, 'Closed', NULL, 'خطای چاپ فاکتور (مثال)', '', NULL, NULL, 0.00000000, 0.00000000, 0, ''),
(2101, 'TT5', NULL, '24', '0', 'Low', NULL, 'Open', NULL, 'درخواست گزارش اختصاصی (مثال)', '', NULL, NULL, 0.00000000, 0.00000000, 0, ''),
(2104, 'TT6', NULL, '25', '0', 'High', NULL, 'In Progress', NULL, 'کندی سیستم در ساعات اوج (مثال)', '', NULL, NULL, 0.00000000, 0.00000000, 0, ''),
(2106, 'TT7', NULL, '2028', '0', 'Normal', NULL, 'Closed', NULL, 'تمدید قرارداد پشتیبانی (مثال)', '', NULL, NULL, 0.00000000, 0.00000000, 0, ''),
(2109, 'TT8', NULL, '2029', '0', 'Normal', NULL, 'Open', NULL, 'درخواست فعال‌سازی ماژول جدید (مثال)', '', NULL, NULL, 0.00000000, 0.00000000, 0, ''),
(2149, 'TT9', NULL, '2036', '0', 'High', 'Major', 'In Progress', 'Other Problem', 'سرویس نصب و راه‌اندازی پکیج پیشرفته (نمونه فاز ۲)', '', NULL, NULL, 0.00000000, 0.00000000, 2107, '');

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

--
-- Table structure for table `vtiger_usageunit`
--

CREATE TABLE `vtiger_usageunit` (
  `usageunitid` int(19) NOT NULL,
  `usageunit` varchar(200) NOT NULL,
  `presence` int(1) NOT NULL DEFAULT 1,
  `picklist_valueid` int(19) NOT NULL DEFAULT 0,
  `sortorderid` int(11) DEFAULT NULL,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_usageunit`
--

INSERT IGNORE INTO `vtiger_usageunit` (`usageunitid`, `usageunit`, `presence`, `picklist_valueid`, `sortorderid`, `color`) VALUES
(1, 'Box', 1, 194, 0, NULL),
(2, 'Carton', 1, 195, 1, NULL),
(3, 'Dozen', 1, 196, 2, NULL),
(4, 'Each', 1, 197, 3, NULL),
(5, 'Hours', 1, 198, 4, NULL),
(6, 'Impressions', 1, 199, 5, NULL),
(7, 'Lb', 1, 200, 6, NULL),
(8, 'M', 1, 201, 7, NULL),
(9, 'Pack', 1, 202, 8, NULL),
(10, 'Pages', 1, 203, 9, NULL),
(11, 'Pieces', 1, 204, 10, NULL),
(12, 'Quantity', 1, 205, 11, NULL),
(13, 'Reams', 1, 206, 12, NULL),
(14, 'Sheet', 1, 207, 13, NULL),
(15, 'Spiral Binder', 1, 208, 14, NULL),
(16, 'Sq Ft', 1, 209, 15, NULL);

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

--
-- Table structure for table `vtiger_usageunit_seq`
--

CREATE TABLE `vtiger_usageunit_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_usageunit_seq`
--

INSERT IGNORE INTO `vtiger_usageunit_seq` (`id`) VALUES
(16);

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

--
-- Table structure for table `vtiger_user2mergefields`
--

CREATE TABLE `vtiger_user2mergefields` (
  `userid` int(11) DEFAULT NULL,
  `tabid` int(19) DEFAULT NULL,
  `fieldid` int(19) DEFAULT NULL,
  `visible` int(2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_user2role`
--

CREATE TABLE `vtiger_user2role` (
  `userid` int(11) NOT NULL,
  `roleid` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_user2role`
--

INSERT IGNORE INTO `vtiger_user2role` (`userid`, `roleid`) VALUES
(1, 'H2'),
(8, 'H29'),
(13, 'H29'),
(14, 'H29'),
(17, 'H29'),
(18, 'H29'),
(19, 'H29'),
(20, 'H29'),
(2, 'H3'),
(6, 'H3'),
(9, 'H30'),
(10, 'H30'),
(12, 'H30'),
(16, 'H30'),
(24, 'H30'),
(25, 'H30'),
(26, 'H30'),
(11, 'H31'),
(15, 'H31'),
(21, 'H31'),
(22, 'H31'),
(23, 'H31'),
(5, 'H4'),
(3, 'H5'),
(4, 'H5'),
(7, 'H5');

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

--
-- Table structure for table `vtiger_users2group`
--

CREATE TABLE `vtiger_users2group` (
  `groupid` int(19) NOT NULL,
  `userid` int(19) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_users2group`
--

INSERT IGNORE INTO `vtiger_users2group` (`groupid`, `userid`) VALUES
(3, 1);

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

--
-- Table structure for table `vtiger_users_last_import`
--

CREATE TABLE `vtiger_users_last_import` (
  `id` int(36) NOT NULL,
  `assigned_user_id` varchar(36) DEFAULT NULL,
  `bean_type` varchar(36) DEFAULT NULL,
  `bean_id` varchar(36) DEFAULT NULL,
  `deleted` int(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_users_seq`
--

CREATE TABLE `vtiger_users_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_users_seq`
--

INSERT IGNORE INTO `vtiger_users_seq` (`id`) VALUES
(24);

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

--
-- Table structure for table `vtiger_user_module_preferences`
--

CREATE TABLE `vtiger_user_module_preferences` (
  `userid` int(19) NOT NULL,
  `tabid` int(19) NOT NULL,
  `default_cvid` int(19) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_vendor`
--

CREATE TABLE `vtiger_vendor` (
  `vendorid` int(19) NOT NULL DEFAULT 0,
  `vendor_no` varchar(100) NOT NULL,
  `vendorname` varchar(100) DEFAULT NULL,
  `phone` varchar(100) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `website` varchar(100) DEFAULT NULL,
  `glacct` varchar(200) DEFAULT NULL,
  `category` varchar(50) DEFAULT NULL,
  `street` text DEFAULT NULL,
  `city` varchar(30) DEFAULT NULL,
  `state` varchar(30) DEFAULT NULL,
  `pobox` varchar(30) DEFAULT NULL,
  `postalcode` varchar(100) DEFAULT NULL,
  `country` varchar(100) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `tags` varchar(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_vendor`
--

INSERT IGNORE INTO `vtiger_vendor` (`vendorid`, `vendor_no`, `vendorname`, `phone`, `email`, `website`, `glacct`, `category`, `street`, `city`, `state`, `pobox`, `postalcode`, `country`, `description`, `tags`) VALUES
(2126, 'VEN1', 'بازرگانی پارت تامین (مثال)', '021-44556677', 'part@test.com', '', NULL, 'قطعات', '', '', '', '', '', '', NULL, ''),
(2127, 'VEN2', 'صنایع فلزی آریا (مثال)', '021-88997766', 'arya@test.com', '', NULL, 'مواد اولیه', '', '', '', '', '', '', NULL, ''),
(2128, 'VEN3', 'پخش البرز (مثال)', '026-32221100', 'alborz@test.com', '', NULL, 'توزیع', '', '', '', '', '', '', NULL, ''),
(2129, 'VEN4', 'تجهیزات نوین صنعت (مثال)', '031-36667788', 'novin@test.com', '', NULL, 'تجهیزات', '', '', '', '', '', '', NULL, '');

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

--
-- Table structure for table `vtiger_vendorcf`
--

CREATE TABLE `vtiger_vendorcf` (
  `vendorid` int(19) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_vendorcf`
--

INSERT IGNORE INTO `vtiger_vendorcf` (`vendorid`) VALUES
(2126),
(2127),
(2128),
(2129);

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

--
-- Table structure for table `vtiger_vendorcontactrel`
--

CREATE TABLE `vtiger_vendorcontactrel` (
  `vendorid` int(19) NOT NULL DEFAULT 0,
  `contactid` int(19) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_version`
--

CREATE TABLE `vtiger_version` (
  `id` int(11) NOT NULL,
  `old_version` varchar(30) DEFAULT NULL,
  `current_version` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_version`
--

INSERT IGNORE INTO `vtiger_version` (`id`, `old_version`, `current_version`) VALUES
(1, '8.4.0', '8.4.0');

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

--
-- Table structure for table `vtiger_version_seq`
--

CREATE TABLE `vtiger_version_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_version_seq`
--

INSERT IGNORE INTO `vtiger_version_seq` (`id`) VALUES
(1);

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

--
-- Table structure for table `vtiger_visibility`
--

CREATE TABLE `vtiger_visibility` (
  `visibilityid` int(19) NOT NULL,
  `visibility` varchar(200) NOT NULL,
  `sortorderid` int(19) NOT NULL DEFAULT 0,
  `presence` int(1) NOT NULL DEFAULT 1,
  `color` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_visibility`
--

INSERT IGNORE INTO `vtiger_visibility` (`visibilityid`, `visibility`, `sortorderid`, `presence`, `color`) VALUES
(1, 'Private', 0, 1, NULL),
(2, 'Public', 1, 1, NULL);

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

--
-- Table structure for table `vtiger_visibility_seq`
--

CREATE TABLE `vtiger_visibility_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_visibility_seq`
--

INSERT IGNORE INTO `vtiger_visibility_seq` (`id`) VALUES
(2);

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

--
-- Table structure for table `vtiger_webforms`
--

CREATE TABLE `vtiger_webforms` (
  `id` int(19) NOT NULL,
  `name` varchar(100) NOT NULL,
  `publicid` varchar(100) NOT NULL,
  `enabled` int(1) NOT NULL DEFAULT 1,
  `targetmodule` varchar(50) NOT NULL,
  `description` text DEFAULT NULL,
  `ownerid` int(19) NOT NULL,
  `returnurl` varchar(250) DEFAULT NULL,
  `captcha` int(1) NOT NULL DEFAULT 0,
  `roundrobin` int(1) NOT NULL DEFAULT 0,
  `roundrobin_userid` varchar(256) DEFAULT NULL,
  `roundrobin_logic` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_webforms_field`
--

CREATE TABLE `vtiger_webforms_field` (
  `id` int(19) NOT NULL,
  `webformid` int(19) NOT NULL,
  `fieldid` int(19) NOT NULL,
  `fieldname` varchar(50) NOT NULL,
  `neutralizedfield` varchar(50) NOT NULL,
  `defaultvalue` text DEFAULT NULL,
  `required` int(10) NOT NULL DEFAULT 0,
  `sequence` int(10) DEFAULT NULL,
  `hidden` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_webform_file_fields`
--

CREATE TABLE `vtiger_webform_file_fields` (
  `id` int(19) NOT NULL,
  `webformid` int(19) NOT NULL,
  `fieldname` varchar(100) NOT NULL,
  `fieldlabel` varchar(100) NOT NULL,
  `required` int(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_wordtemplates`
--

CREATE TABLE `vtiger_wordtemplates` (
  `templateid` int(19) NOT NULL,
  `filename` varchar(100) NOT NULL,
  `module` varchar(30) NOT NULL,
  `date_entered` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `parent_type` varchar(50) NOT NULL,
  `data` longblob NOT NULL,
  `description` text DEFAULT NULL,
  `filesize` varchar(50) NOT NULL,
  `filetype` varchar(20) NOT NULL,
  `deleted` int(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_wsapp_handlerdetails`
--

CREATE TABLE `vtiger_wsapp_handlerdetails` (
  `type` varchar(200) NOT NULL,
  `handlerclass` varchar(100) DEFAULT NULL,
  `handlerpath` varchar(300) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_wsapp_handlerdetails`
--

INSERT IGNORE INTO `vtiger_wsapp_handlerdetails` (`type`, `handlerclass`, `handlerpath`) VALUES
('Outlook', 'OutlookHandler', 'modules/WSAPP/Handlers/OutlookHandler.php'),
('vtigerCRM', 'vtigerCRMHandler', 'modules/WSAPP/Handlers/vtigerCRMHandler.php'),
('vtigerSyncLib', 'WSAPP_VtigerSyncEventHandler', 'modules/WSAPP/synclib/handlers/VtigerSyncEventHandler.php'),
('Google_vtigerHandler', 'Google_Vtiger_Handler', 'modules/Google/handlers/Vtiger.php'),
('Google_vtigerSyncHandler', 'Google_VtigerSync_Handler', 'modules/Google/handlers/VtigerSync.php');

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

--
-- Table structure for table `vtiger_wsapp_logs_basic`
--

CREATE TABLE `vtiger_wsapp_logs_basic` (
  `id` int(25) NOT NULL,
  `extensiontabid` int(19) DEFAULT NULL,
  `module` varchar(50) NOT NULL,
  `sync_datetime` datetime NOT NULL,
  `app_create_count` int(11) DEFAULT NULL,
  `app_update_count` int(11) DEFAULT NULL,
  `app_delete_count` int(11) DEFAULT NULL,
  `app_skip_count` int(11) DEFAULT NULL,
  `vt_create_count` int(11) DEFAULT NULL,
  `vt_update_count` int(11) DEFAULT NULL,
  `vt_delete_count` int(11) DEFAULT NULL,
  `vt_skip_count` int(11) DEFAULT NULL,
  `userid` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_wsapp_logs_details`
--

CREATE TABLE `vtiger_wsapp_logs_details` (
  `id` int(25) NOT NULL,
  `app_create_ids` mediumtext DEFAULT NULL,
  `app_update_ids` mediumtext DEFAULT NULL,
  `app_delete_ids` mediumtext DEFAULT NULL,
  `app_skip_info` mediumtext DEFAULT NULL,
  `vt_create_ids` mediumtext DEFAULT NULL,
  `vt_update_ids` mediumtext DEFAULT NULL,
  `vt_delete_ids` mediumtext DEFAULT NULL,
  `vt_skip_info` mediumtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_wsapp_queuerecords`
--

CREATE TABLE `vtiger_wsapp_queuerecords` (
  `syncserverid` int(19) DEFAULT NULL,
  `details` varchar(300) DEFAULT NULL,
  `flag` varchar(100) DEFAULT NULL,
  `appid` int(19) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_wsapp_recordmapping`
--

CREATE TABLE `vtiger_wsapp_recordmapping` (
  `id` int(19) NOT NULL,
  `serverid` varchar(10) DEFAULT NULL,
  `clientid` varchar(255) DEFAULT NULL,
  `clientmodifiedtime` datetime DEFAULT NULL,
  `appid` int(11) DEFAULT NULL,
  `servermodifiedtime` datetime DEFAULT NULL,
  `serverappid` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_wsapp_sync_state`
--

CREATE TABLE `vtiger_wsapp_sync_state` (
  `id` int(19) NOT NULL,
  `name` varchar(200) DEFAULT NULL,
  `stateencodedvalues` varchar(300) NOT NULL,
  `userid` int(19) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

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

--
-- Table structure for table `vtiger_ws_entity`
--

CREATE TABLE `vtiger_ws_entity` (
  `id` int(11) NOT NULL,
  `name` varchar(25) NOT NULL,
  `handler_path` varchar(255) NOT NULL,
  `handler_class` varchar(64) NOT NULL,
  `ismodule` int(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_ws_entity`
--

INSERT IGNORE INTO `vtiger_ws_entity` (`id`, `name`, `handler_path`, `handler_class`, `ismodule`) VALUES
(1, 'Campaigns', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(2, 'Vendors', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(3, 'Faq', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(4, 'Quotes', 'include/Webservices/LineItem/VtigerInventoryOperation.php', 'VtigerInventoryOperation', 1),
(5, 'PurchaseOrder', 'include/Webservices/LineItem/VtigerInventoryOperation.php', 'VtigerInventoryOperation', 1),
(6, 'SalesOrder', 'include/Webservices/LineItem/VtigerInventoryOperation.php', 'VtigerInventoryOperation', 1),
(7, 'Invoice', 'include/Webservices/LineItem/VtigerInventoryOperation.php', 'VtigerInventoryOperation', 1),
(8, 'PriceBooks', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(9, 'Calendar', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(10, 'Leads', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(11, 'Accounts', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(12, 'Contacts', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(13, 'Potentials', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(14, 'Products', 'include/Webservices/VtigerProductOperation.php', 'VtigerProductOperation', 1),
(15, 'Documents', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(16, 'Emails', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(17, 'HelpDesk', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(18, 'Events', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(19, 'Users', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(20, 'Groups', 'include/Webservices/VtigerActorOperation.php', 'VtigerActorOperation', 0),
(21, 'Currency', 'include/Webservices/VtigerActorOperation.php', 'VtigerActorOperation', 0),
(22, 'DocumentFolders', 'include/Webservices/VtigerActorOperation.php', 'VtigerActorOperation', 0),
(23, 'CompanyDetails', 'include/Webservices/VtigerCompanyDetails.php', 'VtigerCompanyDetails', 0),
(24, 'PBXManager', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(25, 'ServiceContracts', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(26, 'Services', 'include/Webservices/VtigerProductOperation.php', 'VtigerProductOperation', 1),
(27, 'Assets', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(28, 'ModComments', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(29, 'ProjectMilestone', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(30, 'ProjectTask', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(31, 'Project', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(32, 'SMSNotifier', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(33, 'LineItem', 'include/Webservices/LineItem/VtigerLineItemOperation.php', 'VtigerLineItemOperation', 0),
(34, 'Tax', 'include/Webservices/LineItem/VtigerTaxOperation.php', 'VtigerTaxOperation', 0),
(35, 'ProductTaxes', 'include/Webservices/LineItem/VtigerProductTaxesOperation.php', 'VtigerProductTaxesOperation', 0),
(36, 'SarvPayments', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(37, 'SarvParticipations', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(38, 'SarvSurveyResponses', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(39, 'SarvSalesContracts', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(40, 'SarvTargetLists', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(41, 'SarvBankAccounts', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(42, 'SarvDeposits', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(43, 'SarvBusinessLocations', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(44, 'SarvTimeReservations', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(45, 'SarvGifts', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(46, 'SarvProductSamples', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(47, 'SarvAccessGrants', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1),
(48, 'Communications', 'include/Webservices/VtigerModuleOperation.php', 'VtigerModuleOperation', 1);

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

--
-- Table structure for table `vtiger_ws_entity_fieldtype`
--

CREATE TABLE `vtiger_ws_entity_fieldtype` (
  `fieldtypeid` int(19) NOT NULL,
  `table_name` varchar(50) NOT NULL,
  `field_name` varchar(50) NOT NULL,
  `fieldtype` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_ws_entity_fieldtype`
--

INSERT IGNORE INTO `vtiger_ws_entity_fieldtype` (`fieldtypeid`, `table_name`, `field_name`, `fieldtype`) VALUES
(1, 'vtiger_attachmentsfolder', 'createdby', 'reference'),
(2, 'vtiger_organizationdetails', 'logoname', 'file'),
(3, 'vtiger_organizationdetails', 'phone', 'phone'),
(4, 'vtiger_organizationdetails', 'fax', 'phone'),
(5, 'vtiger_organizationdetails', 'website', 'url'),
(6, 'vtiger_inventoryproductrel', 'productid', 'reference'),
(7, 'vtiger_inventoryproductrel', 'id', 'reference'),
(8, 'vtiger_inventoryproductrel', 'incrementondel', 'autogenerated'),
(9, 'vtiger_producttaxrel', 'productid', 'reference'),
(10, 'vtiger_producttaxrel', 'taxid', 'reference');

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

--
-- Table structure for table `vtiger_ws_entity_fieldtype_seq`
--

CREATE TABLE `vtiger_ws_entity_fieldtype_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_ws_entity_fieldtype_seq`
--

INSERT IGNORE INTO `vtiger_ws_entity_fieldtype_seq` (`id`) VALUES
(10);

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

--
-- Table structure for table `vtiger_ws_entity_name`
--

CREATE TABLE `vtiger_ws_entity_name` (
  `entity_id` int(11) NOT NULL,
  `name_fields` varchar(50) NOT NULL,
  `index_field` varchar(50) NOT NULL,
  `table_name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_ws_entity_name`
--

INSERT IGNORE INTO `vtiger_ws_entity_name` (`entity_id`, `name_fields`, `index_field`, `table_name`) VALUES
(20, 'groupname', 'groupid', 'vtiger_groups'),
(21, 'currency_name', 'id', 'vtiger_currency_info'),
(22, 'foldername', 'folderid', 'vtiger_attachmentsfolder'),
(23, 'organizationname', 'groupid', 'vtiger_organizationdetails'),
(34, 'taxlabel', 'taxid', 'vtiger_inventorytaxinfo');

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

--
-- Table structure for table `vtiger_ws_entity_referencetype`
--

CREATE TABLE `vtiger_ws_entity_referencetype` (
  `fieldtypeid` int(19) NOT NULL,
  `type` varchar(25) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_ws_entity_referencetype`
--

INSERT IGNORE INTO `vtiger_ws_entity_referencetype` (`fieldtypeid`, `type`) VALUES
(5, 'Users'),
(6, 'Products'),
(7, 'Invoice'),
(7, 'PurchaseOrder'),
(7, 'Quotes'),
(7, 'SalesOrder'),
(9, 'Products'),
(10, 'Tax');

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

--
-- Table structure for table `vtiger_ws_entity_seq`
--

CREATE TABLE `vtiger_ws_entity_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_ws_entity_seq`
--

INSERT IGNORE INTO `vtiger_ws_entity_seq` (`id`) VALUES
(48);

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

--
-- Table structure for table `vtiger_ws_entity_tables`
--

CREATE TABLE `vtiger_ws_entity_tables` (
  `webservice_entity_id` int(11) NOT NULL,
  `table_name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_ws_entity_tables`
--

INSERT IGNORE INTO `vtiger_ws_entity_tables` (`webservice_entity_id`, `table_name`) VALUES
(20, 'vtiger_groups'),
(21, 'vtiger_currency_info'),
(22, 'vtiger_attachmentsfolder'),
(23, 'vtiger_organizationdetails'),
(33, 'vtiger_inventoryproductrel'),
(34, 'vtiger_inventorytaxinfo'),
(35, 'vtiger_producttaxrel');

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

--
-- Table structure for table `vtiger_ws_fieldinfo`
--

CREATE TABLE `vtiger_ws_fieldinfo` (
  `id` varchar(64) NOT NULL,
  `property_name` varchar(32) DEFAULT NULL,
  `property_value` varchar(64) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_ws_fieldinfo`
--

INSERT IGNORE INTO `vtiger_ws_fieldinfo` (`id`, `property_name`, `property_value`) VALUES
('vtiger_organizationdetails.organization_id', 'upload.path', '1');

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

--
-- Table structure for table `vtiger_ws_fieldtype`
--

CREATE TABLE `vtiger_ws_fieldtype` (
  `fieldtypeid` int(19) NOT NULL,
  `uitype` varchar(30) NOT NULL,
  `fieldtype` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_ws_fieldtype`
--

INSERT IGNORE INTO `vtiger_ws_fieldtype` (`fieldtypeid`, `uitype`, `fieldtype`) VALUES
(1, '15', 'picklist'),
(2, '16', 'picklist'),
(3, '19', 'text'),
(4, '20', 'text'),
(5, '21', 'text'),
(6, '24', 'text'),
(7, '3', 'autogenerated'),
(8, '11', 'phone'),
(9, '33', 'multipicklist'),
(10, '17', 'url'),
(11, '85', 'skype'),
(12, '56', 'boolean'),
(13, '156', 'boolean'),
(14, '53', 'owner'),
(15, '61', 'file'),
(16, '28', 'file'),
(17, '13', 'email'),
(18, '71', 'currency'),
(19, '72', 'currency'),
(20, '50', 'reference'),
(21, '51', 'reference'),
(22, '57', 'reference'),
(23, '58', 'reference'),
(24, '73', 'reference'),
(25, '75', 'reference'),
(26, '76', 'reference'),
(27, '78', 'reference'),
(28, '80', 'reference'),
(29, '81', 'reference'),
(30, '101', 'reference'),
(31, '52', 'reference'),
(32, '357', 'reference'),
(33, '59', 'reference'),
(34, '66', 'reference'),
(35, '77', 'reference'),
(36, '68', 'reference'),
(37, '117', 'reference'),
(38, '26', 'reference'),
(39, '10', 'reference'),
(40, '98', 'reference'),
(41, '69', 'image'),
(42, '1001', 'ownergroup');

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

--
-- Table structure for table `vtiger_ws_operation`
--

CREATE TABLE `vtiger_ws_operation` (
  `operationid` int(11) NOT NULL,
  `name` varchar(128) NOT NULL,
  `handler_path` varchar(255) NOT NULL,
  `handler_method` varchar(64) NOT NULL,
  `type` varchar(8) NOT NULL,
  `prelogin` int(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_ws_operation`
--

INSERT IGNORE INTO `vtiger_ws_operation` (`operationid`, `name`, `handler_path`, `handler_method`, `type`, `prelogin`) VALUES
(1, 'login', 'include/Webservices/Login.php', 'vtws_login', 'POST', 1),
(2, 'retrieve', 'include/Webservices/Retrieve.php', 'vtws_retrieve', 'GET', 0),
(3, 'create', 'include/Webservices/Create.php', 'vtws_create', 'POST', 0),
(4, 'update', 'include/Webservices/Update.php', 'vtws_update', 'POST', 0),
(5, 'delete', 'include/Webservices/Delete.php', 'vtws_delete', 'POST', 0),
(6, 'sync', 'include/Webservices/GetUpdates.php', 'vtws_sync', 'GET', 0),
(7, 'query', 'include/Webservices/Query.php', 'vtws_query', 'GET', 0),
(8, 'logout', 'include/Webservices/Logout.php', 'vtws_logout', 'POST', 0),
(9, 'listtypes', 'include/Webservices/ModuleTypes.php', 'vtws_listtypes', 'GET', 0),
(10, 'getchallenge', 'include/Webservices/AuthToken.php', 'vtws_getchallenge', 'GET', 1),
(11, 'describe', 'include/Webservices/DescribeObject.php', 'vtws_describe', 'GET', 0),
(12, 'extendsession', 'include/Webservices/ExtendSession.php', 'vtws_extendSession', 'POST', 1),
(13, 'convertlead', 'include/Webservices/ConvertLead.php', 'vtws_convertlead', 'POST', 0),
(14, 'revise', 'include/Webservices/Revise.php', 'vtws_revise', 'POST', 0),
(15, 'changePassword', 'include/Webservices/ChangePassword.php', 'vtws_changePassword', 'POST', 0),
(16, 'deleteUser', 'include/Webservices/DeleteUser.php', 'vtws_deleteUser', 'POST', 0),
(17, 'mobile.fetchallalerts', 'modules/Mobile/api/wsapi.php', 'mobile_ws_fetchAllAlerts', 'POST', 0),
(18, 'mobile.alertdetailswithmessage', 'modules/Mobile/api/wsapi.php', 'mobile_ws_alertDetailsWithMessage', 'POST', 0),
(19, 'mobile.fetchmodulefilters', 'modules/Mobile/api/wsapi.php', 'mobile_ws_fetchModuleFilters', 'POST', 0),
(20, 'mobile.fetchrecord', 'modules/Mobile/api/wsapi.php', 'mobile_ws_fetchRecord', 'POST', 0),
(21, 'mobile.fetchrecordwithgrouping', 'modules/Mobile/api/wsapi.php', 'mobile_ws_fetchRecordWithGrouping', 'POST', 0),
(22, 'mobile.filterdetailswithcount', 'modules/Mobile/api/wsapi.php', 'mobile_ws_filterDetailsWithCount', 'POST', 0),
(23, 'mobile.listmodulerecords', 'modules/Mobile/api/wsapi.php', 'mobile_ws_listModuleRecords', 'POST', 0),
(24, 'mobile.saverecord', 'modules/Mobile/api/wsapi.php', 'mobile_ws_saveRecord', 'POST', 0),
(25, 'mobile.syncModuleRecords', 'modules/Mobile/api/wsapi.php', 'mobile_ws_syncModuleRecords', 'POST', 0),
(26, 'mobile.query', 'modules/Mobile/api/wsapi.php', 'mobile_ws_query', 'POST', 0),
(27, 'mobile.querywithgrouping', 'modules/Mobile/api/wsapi.php', 'mobile_ws_queryWithGrouping', 'POST', 0),
(28, 'wsapp_register', 'modules/WSAPP/api/ws/Register.php', 'wsapp_register', 'POST', 0),
(29, 'wsapp_deregister', 'modules/WSAPP/api/ws/DeRegister.php', 'wsapp_deregister', 'POST', 0),
(30, 'wsapp_get', 'modules/WSAPP/api/ws/Get.php', 'wsapp_get', 'POST', 0),
(31, 'wsapp_put', 'modules/WSAPP/api/ws/Put.php', 'wsapp_put', 'POST', 0),
(32, 'wsapp_map', 'modules/WSAPP/api/ws/Map.php', 'wsapp_map', 'POST', 0),
(33, 'retrieve_inventory', 'include/Webservices/LineItem/RetrieveInventory.php', 'vtws_retrieve_inventory', 'GET', 0),
(34, 'relatedtypes', 'include/Webservices/RelatedTypes.php', 'vtws_relatedtypes', 'GET', 0),
(35, 'retrieve_related', 'include/Webservices/RetrieveRelated.php', 'vtws_retrieve_related', 'GET', 0),
(36, 'query_related', 'include/Webservices/QueryRelated.php', 'vtws_query_related', 'GET', 0),
(37, 'add_related', 'include/Webservices/AddRelated.php', 'vtws_add_related', 'POST', 0),
(38, 'files_retrieve', 'include/Webservices/FileRetrieve.php', 'vtws_file_retrieve', 'GET', 0);

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

--
-- Table structure for table `vtiger_ws_operation_parameters`
--

CREATE TABLE `vtiger_ws_operation_parameters` (
  `operationid` int(11) NOT NULL,
  `name` varchar(128) NOT NULL,
  `type` varchar(64) NOT NULL,
  `sequence` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_ws_operation_parameters`
--

INSERT IGNORE INTO `vtiger_ws_operation_parameters` (`operationid`, `name`, `type`, `sequence`) VALUES
(1, 'accessKey', 'String', 2),
(1, 'username', 'String', 1),
(2, 'id', 'String', 1),
(3, 'element', 'encoded', 2),
(3, 'elementType', 'String', 1),
(4, 'element', 'encoded', 1),
(5, 'id', 'String', 1),
(6, 'elementType', 'String', 2),
(6, 'modifiedTime', 'DateTime', 1),
(7, 'query', 'String', 1),
(8, 'sessionName', 'String', 1),
(9, 'fieldTypeList', 'encoded', 1),
(10, 'username', 'String', 1),
(11, 'elementType', 'String', 1),
(13, 'element', 'encoded', 1),
(14, 'element', 'Encoded', 1),
(15, 'confirmPassword', 'String', 4),
(15, 'id', 'String', 1),
(15, 'newPassword', 'String', 3),
(15, 'oldPassword', 'String', 2),
(16, 'id', 'String', 1),
(16, 'newOwnerId', 'String', 2),
(18, 'alertid', 'string', 1),
(19, 'module', 'string', 1),
(20, 'record', 'string', 1),
(21, 'record', 'string', 1),
(22, 'filterid', 'string', 1),
(23, 'elements', 'encoded', 1),
(24, 'module', 'string', 1),
(24, 'record', 'string', 2),
(24, 'values', 'encoded', 3),
(25, 'module', 'string', 1),
(25, 'page', 'string', 3),
(25, 'syncToken', 'string', 2),
(26, 'module', 'string', 1),
(26, 'page', 'string', 3),
(26, 'query', 'string', 2),
(27, 'module', 'string', 1),
(27, 'page', 'string', 3),
(27, 'query', 'string', 2),
(28, 'synctype', 'string', 2),
(28, 'type', 'string', 1),
(29, 'key', 'string', 2),
(29, 'type', 'string', 1),
(30, 'key', 'string', 1),
(30, 'module', 'string', 2),
(30, 'token', 'string', 3),
(31, 'element', 'encoded', 2),
(31, 'key', 'string', 1),
(32, 'element', 'encoded', 2),
(32, 'key', 'string', 1),
(33, 'id', 'String', 1),
(34, 'elementType', 'string', 1),
(35, 'id', 'string', 1),
(35, 'relatedLabel', 'string', 3),
(35, 'relatedType', 'string', 2),
(36, 'id', 'string', 2),
(36, 'query', 'string', 1),
(36, 'relatedLabel', 'string', 3),
(37, 'relatedRecordId', 'string', 2),
(37, 'relationIdLabel', 'string', 3),
(37, 'sourceRecordId', 'string', 1),
(38, 'id', 'string', 1);

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

--
-- Table structure for table `vtiger_ws_operation_seq`
--

CREATE TABLE `vtiger_ws_operation_seq` (
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `vtiger_ws_operation_seq`
--

INSERT IGNORE INTO `vtiger_ws_operation_seq` (`id`) VALUES
(38);

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

--
-- Table structure for table `vtiger_ws_referencetype`
--

CREATE TABLE `vtiger_ws_referencetype` (
  `fieldtypeid` int(19) NOT NULL,
  `type` varchar(25) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `vtiger_ws_referencetype`
--

INSERT IGNORE INTO `vtiger_ws_referencetype` (`fieldtypeid`, `type`) VALUES
(20, 'Accounts'),
(21, 'Accounts'),
(22, 'Contacts'),
(23, 'Campaigns'),
(24, 'Accounts'),
(25, 'Vendors'),
(26, 'Potentials'),
(27, 'Quotes'),
(28, 'SalesOrder'),
(29, 'Vendors'),
(30, 'Users'),
(31, 'Users'),
(32, 'Accounts'),
(32, 'Contacts'),
(32, 'Leads'),
(32, 'Users'),
(32, 'Vendors'),
(33, 'Products'),
(34, 'Accounts'),
(34, 'Campaigns'),
(34, 'HelpDesk'),
(34, 'Invoice'),
(34, 'Leads'),
(34, 'Potentials'),
(34, 'PurchaseOrder'),
(34, 'Quotes'),
(34, 'SalesOrder'),
(35, 'Users'),
(36, 'Accounts'),
(36, 'Contacts'),
(37, 'Currency'),
(38, 'DocumentFolders');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `com_vtiger_workflows`
--
ALTER TABLE `com_vtiger_workflows`
  ADD PRIMARY KEY (`workflow_id`),
  ADD UNIQUE KEY `com_vtiger_workflows_idx` (`workflow_id`);

--
-- Indexes for table `com_vtiger_workflowtasks`
--
ALTER TABLE `com_vtiger_workflowtasks`
  ADD PRIMARY KEY (`task_id`),
  ADD UNIQUE KEY `com_vtiger_workflowtasks_idx` (`task_id`);

--
-- Indexes for table `com_vtiger_workflowtasks_entitymethod`
--
ALTER TABLE `com_vtiger_workflowtasks_entitymethod`
  ADD PRIMARY KEY (`workflowtasks_entitymethod_id`),
  ADD UNIQUE KEY `com_vtiger_workflowtasks_entitymethod_idx` (`workflowtasks_entitymethod_id`);

--
-- Indexes for table `com_vtiger_workflowtemplates`
--
ALTER TABLE `com_vtiger_workflowtemplates`
  ADD PRIMARY KEY (`template_id`);

--
-- Indexes for table `com_vtiger_workflow_activatedonce`
--
ALTER TABLE `com_vtiger_workflow_activatedonce`
  ADD PRIMARY KEY (`workflow_id`,`entity_id`);

--
-- Indexes for table `gooyaacc_cloud_files`
--
ALTER TABLE `gooyaacc_cloud_files`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_cloud_file_attachment` (`current_attachment_id`),
  ADD KEY `idx_cloud_file_owner` (`owner_id`,`deleted`),
  ADD KEY `idx_cloud_file_folder` (`folder_id`,`deleted`),
  ADD KEY `idx_cloud_file_starred` (`owner_id`,`is_starred`,`deleted`),
  ADD KEY `idx_cloud_file_sha` (`sha256`),
  ADD KEY `idx_cloud_file_purge` (`purge_status`,`deleted_at`);

--
-- Indexes for table `gooyaacc_cloud_folders`
--
ALTER TABLE `gooyaacc_cloud_folders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_cloud_folder_owner` (`owner_id`,`deleted`),
  ADD KEY `idx_cloud_folder_parent` (`parent_id`,`deleted`),
  ADD KEY `idx_cloud_folder_root` (`owner_id`,`is_root`);

--
-- Indexes for table `gooyaacc_cloud_log`
--
ALTER TABLE `gooyaacc_cloud_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_cloud_log_request` (`request_id`),
  ADD KEY `idx_cloud_log_user` (`user_id`,`created_at`),
  ADD KEY `idx_cloud_log_action` (`action`,`created_at`),
  ADD KEY `idx_cloud_log_item` (`item_type`,`item_id`,`created_at`),
  ADD KEY `idx_cloud_log_attachment` (`attachment_id`),
  ADD KEY `idx_cloud_log_created` (`created_at`);

--
-- Indexes for table `gooyaacc_cloud_quota`
--
ALTER TABLE `gooyaacc_cloud_quota`
  ADD PRIMARY KEY (`user_id`),
  ADD KEY `idx_cloud_quota_usage` (`used_bytes`,`reserved_bytes`);

--
-- Indexes for table `gooyaacc_cloud_settings`
--
ALTER TABLE `gooyaacc_cloud_settings`
  ADD PRIMARY KEY (`skey`);

--
-- Indexes for table `gooyaacc_cloud_shares`
--
ALTER TABLE `gooyaacc_cloud_shares`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_cloud_share` (`item_type`,`item_id`,`target_type`,`target_id`),
  ADD KEY `idx_cloud_share_target` (`target_type`,`target_id`,`revoked`,`expires_at`),
  ADD KEY `idx_cloud_share_item` (`item_type`,`item_id`,`revoked`),
  ADD KEY `idx_cloud_share_owner` (`owner_id`);

--
-- Indexes for table `gooyaacc_cloud_versions`
--
ALTER TABLE `gooyaacc_cloud_versions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_cloud_file_version` (`file_id`,`version_no`),
  ADD UNIQUE KEY `uq_cloud_version_attachment` (`attachment_id`),
  ADD KEY `idx_cloud_version_file` (`file_id`,`purge_status`),
  ADD KEY `idx_cloud_version_purge` (`purge_status`,`created_at`);

--
-- Indexes for table `gooyaacc_competitors`
--
ALTER TABLE `gooyaacc_competitors`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_owner` (`assigned_user_id`);

--
-- Indexes for table `gooyaacc_forecast_preferences`
--
ALTER TABLE `gooyaacc_forecast_preferences`
  ADD PRIMARY KEY (`user_id`);

--
-- Indexes for table `gooyaacc_kpi_attendance_statuses`
--
ALTER TABLE `gooyaacc_kpi_attendance_statuses`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `gooyaacc_kpi_audit_logs`
--
ALTER TABLE `gooyaacc_kpi_audit_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_kpi_audit_user` (`user_id`);

--
-- Indexes for table `gooyaacc_kpi_avatars`
--
ALTER TABLE `gooyaacc_kpi_avatars`
  ADD PRIMARY KEY (`user_id`);

--
-- Indexes for table `gooyaacc_kpi_ceo_priorities`
--
ALTER TABLE `gooyaacc_kpi_ceo_priorities`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_def` (`kpi_definition_id`);

--
-- Indexes for table `gooyaacc_kpi_definitions`
--
ALTER TABLE `gooyaacc_kpi_definitions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_active` (`is_active`);

--
-- Indexes for table `gooyaacc_kpi_evaluations_main`
--
ALTER TABLE `gooyaacc_kpi_evaluations_main`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_evaluator` (`evaluator_id`),
  ADD KEY `idx_evaluated` (`evaluated_entity_id`,`entity_type`),
  ADD KEY `idx_date` (`evaluation_occurrence_date`);

--
-- Indexes for table `gooyaacc_kpi_evaluation_scores`
--
ALTER TABLE `gooyaacc_kpi_evaluation_scores`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_eval` (`evaluation_id`),
  ADD KEY `idx_def` (`definition_id`);

--
-- Indexes for table `gooyaacc_kpi_evaluation_statuses`
--
ALTER TABLE `gooyaacc_kpi_evaluation_statuses`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `gooyaacc_kpi_evaluator_weights`
--
ALTER TABLE `gooyaacc_kpi_evaluator_weights`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_trole` (`target_role_id`),
  ADD KEY `idx_tuser` (`target_user_id`),
  ADD KEY `idx_tteam` (`target_team_id`),
  ADD KEY `fk_kpi_weight_evaluator_user` (`evaluator_user_id`);

--
-- Indexes for table `gooyaacc_kpi_factor_weights`
--
ALTER TABLE `gooyaacc_kpi_factor_weights`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_key` (`factor_key`);

--
-- Indexes for table `gooyaacc_kpi_license`
--
ALTER TABLE `gooyaacc_kpi_license`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_key` (`license_key`),
  ADD KEY `idx_status` (`status`);

--
-- Indexes for table `gooyaacc_kpi_license_logs`
--
ALTER TABLE `gooyaacc_kpi_license_logs`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `gooyaacc_kpi_permissions`
--
ALTER TABLE `gooyaacc_kpi_permissions`
  ADD PRIMARY KEY (`user_id`),
  ADD KEY `fk_kpi_permission_updater` (`updated_by`);

--
-- Indexes for table `gooyaacc_kpi_roles`
--
ALTER TABLE `gooyaacc_kpi_roles`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `gooyaacc_kpi_saved_filters`
--
ALTER TABLE `gooyaacc_kpi_saved_filters`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_kpi_filter_supervisor` (`supervisor_id`);

--
-- Indexes for table `gooyaacc_kpi_settings`
--
ALTER TABLE `gooyaacc_kpi_settings`
  ADD PRIMARY KEY (`setting_key`);

--
-- Indexes for table `gooyaacc_kpi_supervisor_notes`
--
ALTER TABLE `gooyaacc_kpi_supervisor_notes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_kpi_note_supervisor` (`supervisor_id`),
  ADD KEY `fk_kpi_note_user` (`user_id`);

--
-- Indexes for table `gooyaacc_kpi_target_evaluators`
--
ALTER TABLE `gooyaacc_kpi_target_evaluators`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_def` (`kpi_definition_id`);

--
-- Indexes for table `gooyaacc_kpi_teams`
--
ALTER TABLE `gooyaacc_kpi_teams`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_sarv_team_active` (`deleted`,`name`),
  ADD KEY `fk_kpi_team_supervisor` (`supervisor_id`);

--
-- Indexes for table `gooyaacc_kpi_team_members`
--
ALTER TABLE `gooyaacc_kpi_team_members`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_team_user` (`team_id`,`user_id`),
  ADD KEY `idx_user` (`user_id`);

--
-- Indexes for table `gooyaacc_kpi_user_profile`
--
ALTER TABLE `gooyaacc_kpi_user_profile`
  ADD PRIMARY KEY (`user_id`),
  ADD KEY `idx_role` (`kpi_role_id`),
  ADD KEY `idx_team` (`team_id`),
  ADD KEY `idx_sup` (`supervisor_id`);

--
-- Indexes for table `gooyaacc_notes`
--
ALTER TABLE `gooyaacc_notes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_owner` (`assigned_user_id`);

--
-- Indexes for table `gooyaacc_note_attachments`
--
ALTER TABLE `gooyaacc_note_attachments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_note` (`note_id`),
  ADD KEY `idx_gooya_note_attachment` (`attachment_id`);

--
-- Indexes for table `gooyaacc_pay`
--
ALTER TABLE `gooyaacc_pay`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_acc` (`accountid`),
  ADD KEY `idx_no` (`pay_no`);

--
-- Indexes for table `gooyaacc_payments`
--
ALTER TABLE `gooyaacc_payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_owner` (`assigned_user_id`);

--
-- Indexes for table `gooyaacc_pay_alloc`
--
ALTER TABLE `gooyaacc_pay_alloc`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_pay_inv` (`pay_id`,`invoiceid`),
  ADD KEY `idx_inv` (`invoiceid`);

--
-- Indexes for table `gooyaacc_pdf_templates`
--
ALTER TABLE `gooyaacc_pdf_templates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_owner` (`assigned_user_id`);

--
-- Indexes for table `gooya_account_email`
--
ALTER TABLE `gooya_account_email`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_gooya_account_email_account` (`accountid`);

--
-- Indexes for table `gooya_account_phone`
--
ALTER TABLE `gooya_account_phone`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_gooya_account_phone_account` (`accountid`);

--
-- Indexes for table `gooya_account_timeline`
--
ALTER TABLE `gooya_account_timeline`
  ADD PRIMARY KEY (`timeline_id`),
  ADD UNIQUE KEY `uq_gooya_timeline_dedupe` (`dedupe_key`),
  ADD KEY `idx_gooya_timeline_source` (`source_module`,`source_crmid`),
  ADD KEY `idx_gooya_timeline_account` (`accountid`,`relation_state`,`source_deleted`,`occurred_at`,`timeline_id`);

--
-- Indexes for table `gooya_attachment_storage`
--
ALTER TABLE `gooya_attachment_storage`
  ADD PRIMARY KEY (`attachment_id`),
  ADD KEY `idx_gooya_attachment_source` (`source_module`,`source_record_id`),
  ADD KEY `idx_gooya_attachment_status` (`storage_status`);

--
-- Indexes for table `gooya_contact_account_rel`
--
ALTER TABLE `gooya_contact_account_rel`
  ADD PRIMARY KEY (`relation_id`),
  ADD UNIQUE KEY `uq_gooya_contact_account` (`contactid`,`accountid`),
  ADD UNIQUE KEY `uq_gooya_contact_primary` (`primary_contactid`),
  ADD KEY `idx_gooya_account_contact` (`accountid`,`contactid`),
  ADD KEY `idx_gooya_contact_status` (`contactid`,`relationship_status`);

--
-- Indexes for table `gooya_contact_email`
--
ALTER TABLE `gooya_contact_email`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_gouya_contact_email_contact` (`contactid`),
  ADD KEY `idx_gouya_contact_email_address` (`email_address`);

--
-- Indexes for table `gooya_contact_phone`
--
ALTER TABLE `gooya_contact_phone`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_gouya_contact_phone_contact` (`contactid`),
  ADD KEY `idx_gouya_contact_phone_number` (`phone_number`);

--
-- Indexes for table `gooya_lead_email`
--
ALTER TABLE `gooya_lead_email`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_gooya_lead_email_lead` (`leadid`),
  ADD KEY `idx_gooya_lead_email_address` (`email_address`);

--
-- Indexes for table `gooya_lead_phone`
--
ALTER TABLE `gooya_lead_phone`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_gooya_lead_phone_lead` (`leadid`),
  ADD KEY `idx_gooya_lead_phone_number` (`phone_number`);

--
-- Indexes for table `gooya_upload_session`
--
ALTER TABLE `gooya_upload_session`
  ADD PRIMARY KEY (`upload_id`),
  ADD KEY `idx_gooya_upload_owner` (`user_id`,`upload_status`),
  ADD KEY `idx_gooya_upload_expiry` (`expires_at`);

--
-- Indexes for table `gouya_role_favorites`
--
ALTER TABLE `gouya_role_favorites`
  ADD PRIMARY KEY (`owner_user_id`,`target_role_id`),
  ADD KEY `idx_gouya_role_favorite_target` (`target_role_id`);

--
-- Indexes for table `gouya_topbar_favorites`
--
ALTER TABLE `gouya_topbar_favorites`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_gouya_topbar_favorite` (`user_id`,`route_key`),
  ADD KEY `idx_gouya_topbar_favorite_user` (`user_id`,`updated_at`);

--
-- Indexes for table `gouya_topbar_state`
--
ALTER TABLE `gouya_topbar_state`
  ADD PRIMARY KEY (`user_id`),
  ADD KEY `idx_gouya_topbar_updated` (`updated_at`);

--
-- Indexes for table `gouya_user_favorites`
--
ALTER TABLE `gouya_user_favorites`
  ADD PRIMARY KEY (`owner_user_id`,`target_user_id`),
  ADD KEY `idx_gouya_user_favorite_target` (`target_user_id`);

--
-- Indexes for table `goya_dashboard_widgets`
--
ALTER TABLE `goya_dashboard_widgets`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_user_widget` (`userid`,`widget_key`);

--
-- Indexes for table `goya_onboarding`
--
ALTER TABLE `goya_onboarding`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_user_step` (`userid`,`step_key`);

--
-- Indexes for table `sarv_communications_migration_manifest`
--
ALTER TABLE `sarv_communications_migration_manifest`
  ADD PRIMARY KEY (`source_table`,`source_id`),
  ADD UNIQUE KEY `uq_comm_manifest_record` (`communicationsid`);

--
-- Indexes for table `sarv_field_acl_audit`
--
ALTER TABLE `sarv_field_acl_audit`
  ADD PRIMARY KEY (`audit_id`),
  ADD KEY `idx_sarv_field_acl_audit_rule` (`rule_id`,`created_at`),
  ADD KEY `idx_sarv_field_acl_audit_actor` (`actor_id`,`created_at`);

--
-- Indexes for table `sarv_field_acl_rules`
--
ALTER TABLE `sarv_field_acl_rules`
  ADD PRIMARY KEY (`rule_id`),
  ADD UNIQUE KEY `uq_sarv_field_acl_role_field` (`role_id`,`field_id`),
  ADD KEY `idx_sarv_field_acl_module` (`tab_id`,`field_id`),
  ADD KEY `idx_sarv_field_acl_updated` (`updated_at`);

--
-- Indexes for table `sarv_geographic_regions`
--
ALTER TABLE `sarv_geographic_regions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_sarv_geo_code` (`region_code`),
  ADD KEY `idx_sarv_geo_parent` (`parent_id`,`is_active`,`sort_order`);

--
-- Indexes for table `sarv_module_manager_config`
--
ALTER TABLE `sarv_module_manager_config`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_sarv_module_config_user` (`updated_by`);

--
-- Indexes for table `sarv_module_visibility`
--
ALTER TABLE `sarv_module_visibility`
  ADD PRIMARY KEY (`module_name`),
  ADD UNIQUE KEY `uq_sarv_module_visibility_tab` (`tabid`),
  ADD KEY `idx_sarv_module_visibility_state` (`is_visible`,`position`),
  ADD KEY `fk_sarv_module_visibility_user` (`updated_by`);

--
-- Indexes for table `sarv_module_visibility_audit`
--
ALTER TABLE `sarv_module_visibility_audit`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_sarv_module_audit_time` (`changed_at`),
  ADD KEY `fk_sarv_module_audit_user` (`changed_by`);

--
-- Indexes for table `sarv_password_policy_audit`
--
ALTER TABLE `sarv_password_policy_audit`
  ADD PRIMARY KEY (`audit_id`),
  ADD KEY `idx_sarv_password_audit_actor` (`actor_id`,`created_at`);

--
-- Indexes for table `sarv_payment_allocation_history`
--
ALTER TABLE `sarv_payment_allocation_history`
  ADD PRIMARY KEY (`historyid`),
  ADD KEY `idx_sarv_alloc_history_payment` (`paymentid`,`changedat`),
  ADD KEY `idx_sarv_alloc_history_invoice` (`invoiceid`,`changedat`);

--
-- Indexes for table `sarv_payment_allocation_migration_manifest`
--
ALTER TABLE `sarv_payment_allocation_migration_manifest`
  ADD PRIMARY KEY (`legacy_table`,`legacy_id`),
  ADD KEY `idx_sarv_alloc_manifest_payment` (`paymentid`),
  ADD KEY `fk_sarv_alloc_manifest_invoice` (`invoiceid`);

--
-- Indexes for table `sarv_payment_invoice_rel`
--
ALTER TABLE `sarv_payment_invoice_rel`
  ADD PRIMARY KEY (`paymentid`,`invoiceid`),
  ADD UNIQUE KEY `uq_sarv_payment_legacy_alloc` (`legacy_alloc_id`),
  ADD KEY `idx_sarv_payment_invoice` (`invoiceid`);

--
-- Indexes for table `sarv_payment_migration_manifest`
--
ALTER TABLE `sarv_payment_migration_manifest`
  ADD PRIMARY KEY (`legacy_table`,`legacy_id`),
  ADD UNIQUE KEY `uq_sarv_manifest_payment` (`paymentid`);

--
-- Indexes for table `sarv_phase02_sample_manifest`
--
ALTER TABLE `sarv_phase02_sample_manifest`
  ADD PRIMARY KEY (`sample_key`),
  ADD UNIQUE KEY `uq_sarv_phase02_record` (`module`,`crmid`);

--
-- Indexes for table `sarv_phase03_sample_manifest`
--
ALTER TABLE `sarv_phase03_sample_manifest`
  ADD PRIMARY KEY (`sample_key`,`module`),
  ADD UNIQUE KEY `uq_phase03_crmid` (`crmid`);

--
-- Indexes for table `sarv_phase04_legacy_survey_audit`
--
ALTER TABLE `sarv_phase04_legacy_survey_audit`
  ADD PRIMARY KEY (`legacy_id`);

--
-- Indexes for table `sarv_phase04_sample_manifest`
--
ALTER TABLE `sarv_phase04_sample_manifest`
  ADD PRIMARY KEY (`sample_key`,`module`),
  ADD UNIQUE KEY `uq_phase04_crmid` (`crmid`);

--
-- Indexes for table `sarv_phase05_sample_manifest`
--
ALTER TABLE `sarv_phase05_sample_manifest`
  ADD PRIMARY KEY (`sample_key`,`module`),
  ADD UNIQUE KEY `uq_phase05_crmid` (`crmid`);

--
-- Indexes for table `sarv_phase06_legacy_deposit_audit`
--
ALTER TABLE `sarv_phase06_legacy_deposit_audit`
  ADD PRIMARY KEY (`legacy_id`);

--
-- Indexes for table `sarv_phase06_sample_manifest`
--
ALTER TABLE `sarv_phase06_sample_manifest`
  ADD PRIMARY KEY (`sample_key`,`module`),
  ADD UNIQUE KEY `uq_phase06_crmid` (`crmid`);

--
-- Indexes for table `sarv_phase07_sample_manifest`
--
ALTER TABLE `sarv_phase07_sample_manifest`
  ADD PRIMARY KEY (`sample_key`,`module`),
  ADD UNIQUE KEY `uq_phase07_crmid` (`crmid`);

--
-- Indexes for table `sarv_phase08_legacy_timesheet_audit`
--
ALTER TABLE `sarv_phase08_legacy_timesheet_audit`
  ADD PRIMARY KEY (`legacy_id`);

--
-- Indexes for table `sarv_phase08_sample_manifest`
--
ALTER TABLE `sarv_phase08_sample_manifest`
  ADD PRIMARY KEY (`sample_key`,`module`),
  ADD UNIQUE KEY `uq_phase08_crmid` (`crmid`);

--
-- Indexes for table `sarv_phase09_sample_manifest`
--
ALTER TABLE `sarv_phase09_sample_manifest`
  ADD PRIMARY KEY (`sample_key`,`module`),
  ADD UNIQUE KEY `uq_phase09_crmid` (`crmid`);

--
-- Indexes for table `sarv_phase10_sample_manifest`
--
ALTER TABLE `sarv_phase10_sample_manifest`
  ADD PRIMARY KEY (`sample_key`,`module`),
  ADD UNIQUE KEY `uq_phase10_crmid` (`crmid`);

--
-- Indexes for table `sarv_purchaseorder_stock_ledger`
--
ALTER TABLE `sarv_purchaseorder_stock_ledger`
  ADD PRIMARY KEY (`purchaseorderid`,`productid`),
  ADD KEY `idx_sarv_po_stock_product` (`productid`);

--
-- Indexes for table `sarv_role_audit`
--
ALTER TABLE `sarv_role_audit`
  ADD PRIMARY KEY (`audit_id`),
  ADD KEY `idx_sarv_role_audit_role` (`role_id`,`created_at`);

--
-- Indexes for table `sarv_role_meta`
--
ALTER TABLE `sarv_role_meta`
  ADD PRIMARY KEY (`role_id`),
  ADD KEY `idx_sarv_role_meta_updated` (`updated_at`);

--
-- Indexes for table `sarv_role_permission_override`
--
ALTER TABLE `sarv_role_permission_override`
  ADD PRIMARY KEY (`role_id`,`tab_id`,`operation_id`),
  ADD KEY `idx_sarv_role_permission_state` (`permission_state`);

--
-- Indexes for table `sarv_role_virtual_module_permission`
--
ALTER TABLE `sarv_role_virtual_module_permission`
  ADD PRIMARY KEY (`role_id`,`module_key`),
  ADD KEY `idx_sarv_virtual_module` (`module_key`,`permission_state`);

--
-- Indexes for table `sarv_security_group_audit`
--
ALTER TABLE `sarv_security_group_audit`
  ADD PRIMARY KEY (`audit_id`),
  ADD KEY `idx_sarv_security_group_audit` (`group_id`,`created_at`);

--
-- Indexes for table `sarv_security_group_meta`
--
ALTER TABLE `sarv_security_group_meta`
  ADD PRIMARY KEY (`group_id`),
  ADD KEY `idx_sarv_security_group_owner` (`assigned_user_id`),
  ADD KEY `idx_sarv_security_group_updated` (`updated_at`);

--
-- Indexes for table `sarv_stock_movement_ledger`
--
ALTER TABLE `sarv_stock_movement_ledger`
  ADD PRIMARY KEY (`movement_id`),
  ADD UNIQUE KEY `uq_sarv_stock_source_movement` (`source_module`,`source_record_id`,`movement_code`),
  ADD KEY `idx_sarv_stock_product_time` (`productid`,`createdtime`),
  ADD KEY `idx_sarv_stock_source` (`source_record_id`);

--
-- Indexes for table `sarv_subpanel_visibility`
--
ALTER TABLE `sarv_subpanel_visibility`
  ADD PRIMARY KEY (`panel_key`),
  ADD KEY `idx_sarv_subpanel_relation` (`relation_id`),
  ADD KEY `idx_sarv_subpanel_state` (`is_visible`,`position`);

--
-- Indexes for table `sarv_subpanel_visibility_audit`
--
ALTER TABLE `sarv_subpanel_visibility_audit`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_sarv_subpanel_audit_time` (`changed_at`),
  ADD KEY `idx_sarv_subpanel_audit_user` (`changed_by`);

--
-- Indexes for table `sarv_team_audit`
--
ALTER TABLE `sarv_team_audit`
  ADD PRIMARY KEY (`audit_id`),
  ADD KEY `idx_sarv_team_audit` (`team_id`,`created_at`),
  ADD KEY `idx_sarv_team_audit_actor` (`actor_id`,`created_at`);

--
-- Indexes for table `sarv_user_emails`
--
ALTER TABLE `sarv_user_emails`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_sarv_user_email` (`user_id`,`email_address`),
  ADD KEY `idx_sarv_user_emails_user` (`user_id`,`position`);

--
-- Indexes for table `sarv_user_module_layout`
--
ALTER TABLE `sarv_user_module_layout`
  ADD PRIMARY KEY (`user_id`,`layout_key`),
  ADD KEY `idx_sarv_layout_visible` (`user_id`,`is_visible`,`position`),
  ADD KEY `idx_sarv_layout_tab` (`tabid`),
  ADD KEY `fk_sarv_layout_updated_by` (`updated_by`);

--
-- Indexes for table `sarv_user_phones`
--
ALTER TABLE `sarv_user_phones`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_sarv_user_phones_user` (`user_id`,`position`);

--
-- Indexes for table `sarv_user_profile`
--
ALTER TABLE `sarv_user_profile`
  ADD PRIMARY KEY (`user_id`),
  ADD KEY `idx_sarv_user_profile_updated_by` (`updated_by`),
  ADD KEY `idx_sarv_user_profile_geo_region` (`geo_region_id`);

--
-- Indexes for table `sarv_user_profile_audit`
--
ALTER TABLE `sarv_user_profile_audit`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_sarv_user_audit` (`user_id`,`changed_at`),
  ADD KEY `idx_sarv_user_audit_by` (`changed_by`);

--
-- Indexes for table `vtiger_access_level`
--
ALTER TABLE `vtiger_access_level`
  ADD PRIMARY KEY (`access_levelid`);

--
-- Indexes for table `vtiger_account`
--
ALTER TABLE `vtiger_account`
  ADD PRIMARY KEY (`accountid`),
  ADD KEY `account_account_type_idx` (`account_type`),
  ADD KEY `email_idx` (`email1`,`email2`),
  ADD KEY `idx_account_parentid` (`parentid`);

--
-- Indexes for table `vtiger_accountbillads`
--
ALTER TABLE `vtiger_accountbillads`
  ADD PRIMARY KEY (`accountaddressid`);

--
-- Indexes for table `vtiger_accountrating`
--
ALTER TABLE `vtiger_accountrating`
  ADD PRIMARY KEY (`accountratingid`),
  ADD UNIQUE KEY `accountrating_rating_idx` (`rating`);

--
-- Indexes for table `vtiger_accountscf`
--
ALTER TABLE `vtiger_accountscf`
  ADD PRIMARY KEY (`accountid`);

--
-- Indexes for table `vtiger_accountshipads`
--
ALTER TABLE `vtiger_accountshipads`
  ADD PRIMARY KEY (`accountaddressid`);

--
-- Indexes for table `vtiger_accounttype`
--
ALTER TABLE `vtiger_accounttype`
  ADD PRIMARY KEY (`accounttypeid`),
  ADD UNIQUE KEY `accounttype_accounttype_idx` (`accounttype`);

--
-- Indexes for table `vtiger_account_status`
--
ALTER TABLE `vtiger_account_status`
  ADD PRIMARY KEY (`account_statusid`);

--
-- Indexes for table `vtiger_account_type`
--
ALTER TABLE `vtiger_account_type`
  ADD PRIMARY KEY (`account_typeid`);

--
-- Indexes for table `vtiger_actionmapping`
--
ALTER TABLE `vtiger_actionmapping`
  ADD PRIMARY KEY (`actionid`,`actionname`);

--
-- Indexes for table `vtiger_activity`
--
ALTER TABLE `vtiger_activity`
  ADD PRIMARY KEY (`activityid`),
  ADD KEY `activity_activityid_subject_idx` (`activityid`,`subject`),
  ADD KEY `activity_activitytype_date_start_idx` (`activitytype`,`date_start`),
  ADD KEY `activity_date_start_due_date_idx` (`date_start`,`due_date`),
  ADD KEY `activity_date_start_time_start_idx` (`date_start`,`time_start`),
  ADD KEY `activity_eventstatus_idx` (`eventstatus`),
  ADD KEY `activity_status_idx` (`status`);

--
-- Indexes for table `vtiger_activitycf`
--
ALTER TABLE `vtiger_activitycf`
  ADD PRIMARY KEY (`activityid`);

--
-- Indexes for table `vtiger_activityproductrel`
--
ALTER TABLE `vtiger_activityproductrel`
  ADD PRIMARY KEY (`activityid`,`productid`),
  ADD KEY `activityproductrel_activityid_idx` (`activityid`),
  ADD KEY `activityproductrel_productid_idx` (`productid`);

--
-- Indexes for table `vtiger_activitytype`
--
ALTER TABLE `vtiger_activitytype`
  ADD PRIMARY KEY (`activitytypeid`),
  ADD UNIQUE KEY `activitytype_activitytype_idx` (`activitytype`);

--
-- Indexes for table `vtiger_activity_reminder`
--
ALTER TABLE `vtiger_activity_reminder`
  ADD PRIMARY KEY (`activity_id`,`recurringid`);

--
-- Indexes for table `vtiger_activity_reminder_popup`
--
ALTER TABLE `vtiger_activity_reminder_popup`
  ADD PRIMARY KEY (`reminderid`);

--
-- Indexes for table `vtiger_activity_view`
--
ALTER TABLE `vtiger_activity_view`
  ADD PRIMARY KEY (`activity_viewid`);

--
-- Indexes for table `vtiger_announcement`
--
ALTER TABLE `vtiger_announcement`
  ADD PRIMARY KEY (`creatorid`),
  ADD KEY `announcement_creatorid_idx` (`creatorid`);

--
-- Indexes for table `vtiger_app2tab`
--
ALTER TABLE `vtiger_app2tab`
  ADD KEY `vtiger_app2tab_fk_tab` (`tabid`);

--
-- Indexes for table `vtiger_assets`
--
ALTER TABLE `vtiger_assets`
  ADD PRIMARY KEY (`assetsid`),
  ADD KEY `idx_assets_account` (`account`),
  ADD KEY `idx_assets_contact` (`contact`),
  ADD KEY `idx_assets_invoice` (`invoiceid`);

--
-- Indexes for table `vtiger_assetscf`
--
ALTER TABLE `vtiger_assetscf`
  ADD PRIMARY KEY (`assetsid`);

--
-- Indexes for table `vtiger_assetstatus`
--
ALTER TABLE `vtiger_assetstatus`
  ADD PRIMARY KEY (`assetstatusid`);

--
-- Indexes for table `vtiger_asteriskincomingevents`
--
ALTER TABLE `vtiger_asteriskincomingevents`
  ADD PRIMARY KEY (`uid`);

--
-- Indexes for table `vtiger_attachments`
--
ALTER TABLE `vtiger_attachments`
  ADD PRIMARY KEY (`attachmentsid`),
  ADD KEY `attachments_attachmentsid_idx` (`attachmentsid`);

--
-- Indexes for table `vtiger_attachmentsfolder`
--
ALTER TABLE `vtiger_attachmentsfolder`
  ADD PRIMARY KEY (`folderid`);

--
-- Indexes for table `vtiger_audit_trial`
--
ALTER TABLE `vtiger_audit_trial`
  ADD PRIMARY KEY (`auditid`);

--
-- Indexes for table `vtiger_blocks`
--
ALTER TABLE `vtiger_blocks`
  ADD PRIMARY KEY (`blockid`),
  ADD KEY `block_tabid_idx` (`tabid`);

--
-- Indexes for table `vtiger_calendarsharedtype`
--
ALTER TABLE `vtiger_calendarsharedtype`
  ADD PRIMARY KEY (`calendarsharedtypeid`);

--
-- Indexes for table `vtiger_calendar_default_activitytypes`
--
ALTER TABLE `vtiger_calendar_default_activitytypes`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_calendar_user_activitytypes`
--
ALTER TABLE `vtiger_calendar_user_activitytypes`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_callduration`
--
ALTER TABLE `vtiger_callduration`
  ADD PRIMARY KEY (`calldurationid`);

--
-- Indexes for table `vtiger_call_direction`
--
ALTER TABLE `vtiger_call_direction`
  ADD PRIMARY KEY (`call_directionid`);

--
-- Indexes for table `vtiger_campaign`
--
ALTER TABLE `vtiger_campaign`
  ADD PRIMARY KEY (`campaignid`),
  ADD KEY `campaign_campaignstatus_idx` (`campaignstatus`),
  ADD KEY `campaign_campaignname_idx` (`campaignname`),
  ADD KEY `campaign_campaignid_idx` (`campaignid`);

--
-- Indexes for table `vtiger_campaignaccountrel`
--
ALTER TABLE `vtiger_campaignaccountrel`
  ADD UNIQUE KEY `uq_campaign_account` (`campaignid`,`accountid`),
  ADD KEY `idx_campaignaccountrel_account` (`accountid`);

--
-- Indexes for table `vtiger_campaigncontrel`
--
ALTER TABLE `vtiger_campaigncontrel`
  ADD PRIMARY KEY (`campaignid`,`contactid`,`campaignrelstatusid`),
  ADD KEY `campaigncontrel_contractid_idx` (`contactid`);

--
-- Indexes for table `vtiger_campaignleadrel`
--
ALTER TABLE `vtiger_campaignleadrel`
  ADD PRIMARY KEY (`campaignid`,`leadid`,`campaignrelstatusid`),
  ADD KEY `campaignleadrel_leadid_campaignid_idx` (`leadid`,`campaignid`);

--
-- Indexes for table `vtiger_campaignscf`
--
ALTER TABLE `vtiger_campaignscf`
  ADD PRIMARY KEY (`campaignid`);

--
-- Indexes for table `vtiger_campaignstatus`
--
ALTER TABLE `vtiger_campaignstatus`
  ADD PRIMARY KEY (`campaignstatusid`),
  ADD KEY `campaignstatus_campaignstatus_idx` (`campaignstatus`);

--
-- Indexes for table `vtiger_campaigntype`
--
ALTER TABLE `vtiger_campaigntype`
  ADD PRIMARY KEY (`campaigntypeid`),
  ADD UNIQUE KEY `campaigntype_campaigntype_idx` (`campaigntype`);

--
-- Indexes for table `vtiger_carrier`
--
ALTER TABLE `vtiger_carrier`
  ADD PRIMARY KEY (`carrierid`),
  ADD UNIQUE KEY `carrier_carrier_idx` (`carrier`);

--
-- Indexes for table `vtiger_cf_credit_source`
--
ALTER TABLE `vtiger_cf_credit_source`
  ADD PRIMARY KEY (`cf_credit_sourceid`);

--
-- Indexes for table `vtiger_cf_credit_status`
--
ALTER TABLE `vtiger_cf_credit_status`
  ADD PRIMARY KEY (`cf_credit_statusid`);

--
-- Indexes for table `vtiger_cf_credit_type`
--
ALTER TABLE `vtiger_cf_credit_type`
  ADD PRIMARY KEY (`cf_credit_typeid`);

--
-- Indexes for table `vtiger_cf_forecast_category`
--
ALTER TABLE `vtiger_cf_forecast_category`
  ADD PRIMARY KEY (`cf_forecast_categoryid`);

--
-- Indexes for table `vtiger_cf_grouping1`
--
ALTER TABLE `vtiger_cf_grouping1`
  ADD PRIMARY KEY (`cf_grouping1id`);

--
-- Indexes for table `vtiger_cf_grouping2`
--
ALTER TABLE `vtiger_cf_grouping2`
  ADD PRIMARY KEY (`cf_grouping2id`);

--
-- Indexes for table `vtiger_cf_invoice_cycles`
--
ALTER TABLE `vtiger_cf_invoice_cycles`
  ADD PRIMARY KEY (`cf_invoice_cyclesid`);

--
-- Indexes for table `vtiger_cf_invoice_kind`
--
ALTER TABLE `vtiger_cf_invoice_kind`
  ADD PRIMARY KEY (`cf_invoice_kindid`);

--
-- Indexes for table `vtiger_cf_lead_party_type`
--
ALTER TABLE `vtiger_cf_lead_party_type`
  ADD PRIMARY KEY (`cf_lead_party_typeid`);

--
-- Indexes for table `vtiger_cf_loss_reason`
--
ALTER TABLE `vtiger_cf_loss_reason`
  ADD PRIMARY KEY (`cf_loss_reasonid`);

--
-- Indexes for table `vtiger_cf_opportunity_currency`
--
ALTER TABLE `vtiger_cf_opportunity_currency`
  ADD PRIMARY KEY (`cf_opportunity_currencyid`);

--
-- Indexes for table `vtiger_cf_opportunity_priority`
--
ALTER TABLE `vtiger_cf_opportunity_priority`
  ADD PRIMARY KEY (`cf_opportunity_priorityid`);

--
-- Indexes for table `vtiger_cf_party_type`
--
ALTER TABLE `vtiger_cf_party_type`
  ADD PRIMARY KEY (`cf_party_typeid`);

--
-- Indexes for table `vtiger_cf_sales_process`
--
ALTER TABLE `vtiger_cf_sales_process`
  ADD PRIMARY KEY (`cf_sales_processid`);

--
-- Indexes for table `vtiger_channel`
--
ALTER TABLE `vtiger_channel`
  ADD PRIMARY KEY (`channelid`);

--
-- Indexes for table `vtiger_cntactivityrel`
--
ALTER TABLE `vtiger_cntactivityrel`
  ADD PRIMARY KEY (`contactid`,`activityid`),
  ADD KEY `cntactivityrel_contactid_idx` (`contactid`),
  ADD KEY `cntactivityrel_activityid_idx` (`activityid`);

--
-- Indexes for table `vtiger_communications`
--
ALTER TABLE `vtiger_communications`
  ADD PRIMARY KEY (`communicationsid`);

--
-- Indexes for table `vtiger_communicationscf`
--
ALTER TABLE `vtiger_communicationscf`
  ADD PRIMARY KEY (`communicationsid`);

--
-- Indexes for table `vtiger_communications_audit`
--
ALTER TABLE `vtiger_communications_audit`
  ADD PRIMARY KEY (`auditid`),
  ADD KEY `idx_comm_audit_record` (`communicationsid`,`event_time`);

--
-- Indexes for table `vtiger_contactaddress`
--
ALTER TABLE `vtiger_contactaddress`
  ADD PRIMARY KEY (`contactaddressid`);

--
-- Indexes for table `vtiger_contactdetails`
--
ALTER TABLE `vtiger_contactdetails`
  ADD PRIMARY KEY (`contactid`),
  ADD KEY `contactdetails_accountid_idx` (`accountid`),
  ADD KEY `email_idx` (`email`);

--
-- Indexes for table `vtiger_contactscf`
--
ALTER TABLE `vtiger_contactscf`
  ADD PRIMARY KEY (`contactid`);

--
-- Indexes for table `vtiger_contactsubdetails`
--
ALTER TABLE `vtiger_contactsubdetails`
  ADD PRIMARY KEY (`contactsubscriptionid`);

--
-- Indexes for table `vtiger_contpotentialrel`
--
ALTER TABLE `vtiger_contpotentialrel`
  ADD PRIMARY KEY (`contactid`,`potentialid`),
  ADD KEY `contpotentialrel_potentialid_idx` (`potentialid`),
  ADD KEY `contpotentialrel_contactid_idx` (`contactid`);

--
-- Indexes for table `vtiger_contract_priority`
--
ALTER TABLE `vtiger_contract_priority`
  ADD PRIMARY KEY (`contract_priorityid`);

--
-- Indexes for table `vtiger_contract_status`
--
ALTER TABLE `vtiger_contract_status`
  ADD PRIMARY KEY (`contract_statusid`);

--
-- Indexes for table `vtiger_contract_type`
--
ALTER TABLE `vtiger_contract_type`
  ADD PRIMARY KEY (`contract_typeid`);

--
-- Indexes for table `vtiger_convertleadmapping`
--
ALTER TABLE `vtiger_convertleadmapping`
  ADD PRIMARY KEY (`cfmid`);

--
-- Indexes for table `vtiger_convertpotentialmapping`
--
ALTER TABLE `vtiger_convertpotentialmapping`
  ADD PRIMARY KEY (`cfmid`);

--
-- Indexes for table `vtiger_crmentity`
--
ALTER TABLE `vtiger_crmentity`
  ADD PRIMARY KEY (`crmid`),
  ADD KEY `crmentity_smcreatorid_idx` (`smcreatorid`),
  ADD KEY `crmentity_modifiedby_idx` (`modifiedby`),
  ADD KEY `crmentity_deleted_idx` (`deleted`),
  ADD KEY `crm_ownerid_del_setype_idx` (`smownerid`,`deleted`,`setype`),
  ADD KEY `vtiger_crmentity_labelidx` (`label`);

--
-- Indexes for table `vtiger_crmentityrel`
--
ALTER TABLE `vtiger_crmentityrel`
  ADD KEY `crmid_idx` (`crmid`),
  ADD KEY `relcrmid_idx` (`relcrmid`);

--
-- Indexes for table `vtiger_crmentity_user_field`
--
ALTER TABLE `vtiger_crmentity_user_field`
  ADD KEY `record_user_idx` (`recordid`,`userid`);

--
-- Indexes for table `vtiger_cron_task`
--
ALTER TABLE `vtiger_cron_task`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`),
  ADD UNIQUE KEY `handler_file` (`handler_file`);

--
-- Indexes for table `vtiger_currencies`
--
ALTER TABLE `vtiger_currencies`
  ADD PRIMARY KEY (`currencyid`);

--
-- Indexes for table `vtiger_currency`
--
ALTER TABLE `vtiger_currency`
  ADD PRIMARY KEY (`currencyid`),
  ADD UNIQUE KEY `currency_currency_idx` (`currency`);

--
-- Indexes for table `vtiger_currency_decimal_separator`
--
ALTER TABLE `vtiger_currency_decimal_separator`
  ADD PRIMARY KEY (`currency_decimal_separatorid`);

--
-- Indexes for table `vtiger_currency_grouping_pattern`
--
ALTER TABLE `vtiger_currency_grouping_pattern`
  ADD PRIMARY KEY (`currency_grouping_patternid`);

--
-- Indexes for table `vtiger_currency_grouping_separator`
--
ALTER TABLE `vtiger_currency_grouping_separator`
  ADD PRIMARY KEY (`currency_grouping_separatorid`);

--
-- Indexes for table `vtiger_currency_info`
--
ALTER TABLE `vtiger_currency_info`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_currency_symbol_placement`
--
ALTER TABLE `vtiger_currency_symbol_placement`
  ADD PRIMARY KEY (`currency_symbol_placementid`);

--
-- Indexes for table `vtiger_customaction`
--
ALTER TABLE `vtiger_customaction`
  ADD KEY `customaction_cvid_idx` (`cvid`);

--
-- Indexes for table `vtiger_customerdetails`
--
ALTER TABLE `vtiger_customerdetails`
  ADD PRIMARY KEY (`customerid`);

--
-- Indexes for table `vtiger_customerportal_fields`
--
ALTER TABLE `vtiger_customerportal_fields`
  ADD PRIMARY KEY (`tabid`);

--
-- Indexes for table `vtiger_customerportal_prefs`
--
ALTER TABLE `vtiger_customerportal_prefs`
  ADD PRIMARY KEY (`tabid`,`prefkey`);

--
-- Indexes for table `vtiger_customerportal_relatedmoduleinfo`
--
ALTER TABLE `vtiger_customerportal_relatedmoduleinfo`
  ADD PRIMARY KEY (`tabid`);

--
-- Indexes for table `vtiger_customerportal_tabs`
--
ALTER TABLE `vtiger_customerportal_tabs`
  ADD PRIMARY KEY (`tabid`);

--
-- Indexes for table `vtiger_customview`
--
ALTER TABLE `vtiger_customview`
  ADD PRIMARY KEY (`cvid`),
  ADD KEY `customview_entitytype_idx` (`entitytype`);

--
-- Indexes for table `vtiger_cv2group`
--
ALTER TABLE `vtiger_cv2group`
  ADD KEY `vtiger_cv2group_ibfk_1` (`cvid`),
  ADD KEY `vtiger_groups_ibfk_1` (`groupid`);

--
-- Indexes for table `vtiger_cv2role`
--
ALTER TABLE `vtiger_cv2role`
  ADD KEY `vtiger_cv2role_ibfk_1` (`cvid`),
  ADD KEY `vtiger_role_ibfk_1` (`roleid`);

--
-- Indexes for table `vtiger_cv2rs`
--
ALTER TABLE `vtiger_cv2rs`
  ADD KEY `vtiger_cv2role_ibfk_1` (`cvid`),
  ADD KEY `vtiger_rolesd_ibfk_1` (`rsid`);

--
-- Indexes for table `vtiger_cv2users`
--
ALTER TABLE `vtiger_cv2users`
  ADD KEY `vtiger_cv2users_ibfk_1` (`cvid`),
  ADD KEY `vtiger_users_ibfk_1` (`userid`);

--
-- Indexes for table `vtiger_cvadvfilter`
--
ALTER TABLE `vtiger_cvadvfilter`
  ADD PRIMARY KEY (`cvid`,`columnindex`),
  ADD KEY `cvadvfilter_cvid_idx` (`cvid`);

--
-- Indexes for table `vtiger_cvadvfilter_grouping`
--
ALTER TABLE `vtiger_cvadvfilter_grouping`
  ADD PRIMARY KEY (`groupid`,`cvid`);

--
-- Indexes for table `vtiger_cvcolumnlist`
--
ALTER TABLE `vtiger_cvcolumnlist`
  ADD PRIMARY KEY (`cvid`,`columnindex`),
  ADD KEY `cvcolumnlist_columnindex_idx` (`columnindex`),
  ADD KEY `cvcolumnlist_cvid_idx` (`cvid`);

--
-- Indexes for table `vtiger_cvstdfilter`
--
ALTER TABLE `vtiger_cvstdfilter`
  ADD KEY `cvstdfilter_cvid_idx` (`cvid`);

--
-- Indexes for table `vtiger_dashboard_tabs`
--
ALTER TABLE `vtiger_dashboard_tabs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `tabname` (`tabname`,`userid`),
  ADD KEY `vtiger_dashboard_tabs_ibfk_1` (`userid`);

--
-- Indexes for table `vtiger_datashare_grp2grp`
--
ALTER TABLE `vtiger_datashare_grp2grp`
  ADD PRIMARY KEY (`shareid`),
  ADD KEY `datashare_grp2grp_share_groupid_idx` (`share_groupid`),
  ADD KEY `datashare_grp2grp_to_groupid_idx` (`to_groupid`);

--
-- Indexes for table `vtiger_datashare_grp2role`
--
ALTER TABLE `vtiger_datashare_grp2role`
  ADD PRIMARY KEY (`shareid`),
  ADD KEY `idx_datashare_grp2role_share_groupid` (`share_groupid`),
  ADD KEY `idx_datashare_grp2role_to_roleid` (`to_roleid`);

--
-- Indexes for table `vtiger_datashare_grp2rs`
--
ALTER TABLE `vtiger_datashare_grp2rs`
  ADD PRIMARY KEY (`shareid`),
  ADD KEY `datashare_grp2rs_share_groupid_idx` (`share_groupid`),
  ADD KEY `datashare_grp2rs_to_roleandsubid_idx` (`to_roleandsubid`);

--
-- Indexes for table `vtiger_datashare_module_rel`
--
ALTER TABLE `vtiger_datashare_module_rel`
  ADD PRIMARY KEY (`shareid`),
  ADD KEY `idx_datashare_module_rel_tabid` (`tabid`);

--
-- Indexes for table `vtiger_datashare_relatedmodules`
--
ALTER TABLE `vtiger_datashare_relatedmodules`
  ADD PRIMARY KEY (`datashare_relatedmodule_id`),
  ADD KEY `datashare_relatedmodules_tabid_idx` (`tabid`),
  ADD KEY `datashare_relatedmodules_relatedto_tabid_idx` (`relatedto_tabid`);

--
-- Indexes for table `vtiger_datashare_relatedmodule_permission`
--
ALTER TABLE `vtiger_datashare_relatedmodule_permission`
  ADD PRIMARY KEY (`shareid`,`datashare_relatedmodule_id`),
  ADD KEY `datashare_relatedmodule_permission_shareid_permissions_idx` (`shareid`,`permission`);

--
-- Indexes for table `vtiger_datashare_role2group`
--
ALTER TABLE `vtiger_datashare_role2group`
  ADD PRIMARY KEY (`shareid`),
  ADD KEY `idx_datashare_role2group_share_roleid` (`share_roleid`),
  ADD KEY `idx_datashare_role2group_to_groupid` (`to_groupid`);

--
-- Indexes for table `vtiger_datashare_role2role`
--
ALTER TABLE `vtiger_datashare_role2role`
  ADD PRIMARY KEY (`shareid`),
  ADD KEY `datashare_role2role_share_roleid_idx` (`share_roleid`),
  ADD KEY `datashare_role2role_to_roleid_idx` (`to_roleid`);

--
-- Indexes for table `vtiger_datashare_role2rs`
--
ALTER TABLE `vtiger_datashare_role2rs`
  ADD PRIMARY KEY (`shareid`),
  ADD KEY `datashare_role2s_share_roleid_idx` (`share_roleid`),
  ADD KEY `datashare_role2s_to_roleandsubid_idx` (`to_roleandsubid`);

--
-- Indexes for table `vtiger_datashare_rs2grp`
--
ALTER TABLE `vtiger_datashare_rs2grp`
  ADD PRIMARY KEY (`shareid`),
  ADD KEY `datashare_rs2grp_share_roleandsubid_idx` (`share_roleandsubid`),
  ADD KEY `datashare_rs2grp_to_groupid_idx` (`to_groupid`);

--
-- Indexes for table `vtiger_datashare_rs2role`
--
ALTER TABLE `vtiger_datashare_rs2role`
  ADD PRIMARY KEY (`shareid`),
  ADD KEY `datashare_rs2role_share_roleandsubid_idx` (`share_roleandsubid`),
  ADD KEY `datashare_rs2role_to_roleid_idx` (`to_roleid`);

--
-- Indexes for table `vtiger_datashare_rs2rs`
--
ALTER TABLE `vtiger_datashare_rs2rs`
  ADD PRIMARY KEY (`shareid`),
  ADD KEY `datashare_rs2rs_share_roleandsubid_idx` (`share_roleandsubid`),
  ADD KEY `idx_datashare_rs2rs_to_roleandsubid_idx` (`to_roleandsubid`);

--
-- Indexes for table `vtiger_date_format`
--
ALTER TABLE `vtiger_date_format`
  ADD PRIMARY KEY (`date_formatid`);

--
-- Indexes for table `vtiger_dayoftheweek`
--
ALTER TABLE `vtiger_dayoftheweek`
  ADD PRIMARY KEY (`dayoftheweekid`);

--
-- Indexes for table `vtiger_defaultactivitytype`
--
ALTER TABLE `vtiger_defaultactivitytype`
  ADD PRIMARY KEY (`defaultactivitytypeid`);

--
-- Indexes for table `vtiger_defaultcalendarview`
--
ALTER TABLE `vtiger_defaultcalendarview`
  ADD PRIMARY KEY (`defaultcalendarviewid`);

--
-- Indexes for table `vtiger_defaultcv`
--
ALTER TABLE `vtiger_defaultcv`
  ADD PRIMARY KEY (`tabid`);

--
-- Indexes for table `vtiger_defaulteventstatus`
--
ALTER TABLE `vtiger_defaulteventstatus`
  ADD PRIMARY KEY (`defaulteventstatusid`);

--
-- Indexes for table `vtiger_defaultlandingpage`
--
ALTER TABLE `vtiger_defaultlandingpage`
  ADD PRIMARY KEY (`defaultlandingpageid`);

--
-- Indexes for table `vtiger_default_record_view`
--
ALTER TABLE `vtiger_default_record_view`
  ADD PRIMARY KEY (`default_record_viewid`);

--
-- Indexes for table `vtiger_def_org_field`
--
ALTER TABLE `vtiger_def_org_field`
  ADD PRIMARY KEY (`fieldid`),
  ADD KEY `def_org_field_tabid_fieldid_idx` (`tabid`,`fieldid`),
  ADD KEY `def_org_field_tabid_idx` (`tabid`),
  ADD KEY `def_org_field_visible_fieldid_idx` (`visible`,`fieldid`);

--
-- Indexes for table `vtiger_def_org_share`
--
ALTER TABLE `vtiger_def_org_share`
  ADD PRIMARY KEY (`ruleid`),
  ADD KEY `fk_1_vtiger_def_org_share` (`permission`);

--
-- Indexes for table `vtiger_deposit_status`
--
ALTER TABLE `vtiger_deposit_status`
  ADD PRIMARY KEY (`deposit_statusid`);

--
-- Indexes for table `vtiger_deposit_type`
--
ALTER TABLE `vtiger_deposit_type`
  ADD PRIMARY KEY (`deposit_typeid`);

--
-- Indexes for table `vtiger_durationhrs`
--
ALTER TABLE `vtiger_durationhrs`
  ADD PRIMARY KEY (`hrsid`);

--
-- Indexes for table `vtiger_durationmins`
--
ALTER TABLE `vtiger_durationmins`
  ADD PRIMARY KEY (`minsid`);

--
-- Indexes for table `vtiger_duration_minutes`
--
ALTER TABLE `vtiger_duration_minutes`
  ADD PRIMARY KEY (`minutesid`);

--
-- Indexes for table `vtiger_emaildetails`
--
ALTER TABLE `vtiger_emaildetails`
  ADD PRIMARY KEY (`emailid`);

--
-- Indexes for table `vtiger_emailslookup`
--
ALTER TABLE `vtiger_emailslookup`
  ADD UNIQUE KEY `emailslookup_crmid_setype_fieldname_uk` (`crmid`,`setype`,`fieldid`),
  ADD KEY `emailslookup_fieldid_setype_idx` (`fieldid`,`setype`);

--
-- Indexes for table `vtiger_emails_recipientprefs`
--
ALTER TABLE `vtiger_emails_recipientprefs`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_emailtemplates`
--
ALTER TABLE `vtiger_emailtemplates`
  ADD PRIMARY KEY (`templateid`),
  ADD KEY `emailtemplates_foldernamd_templatename_subject_idx` (`foldername`,`templatename`,`subject`);

--
-- Indexes for table `vtiger_email_track`
--
ALTER TABLE `vtiger_email_track`
  ADD UNIQUE KEY `link_tabidtype_idx` (`crmid`,`mailid`);

--
-- Indexes for table `vtiger_entityname`
--
ALTER TABLE `vtiger_entityname`
  ADD PRIMARY KEY (`tabid`),
  ADD KEY `entityname_tabid_idx` (`tabid`);

--
-- Indexes for table `vtiger_eventhandlers`
--
ALTER TABLE `vtiger_eventhandlers`
  ADD PRIMARY KEY (`eventhandler_id`,`event_name`,`handler_class`),
  ADD UNIQUE KEY `eventhandler_idx` (`eventhandler_id`);

--
-- Indexes for table `vtiger_eventhandler_module`
--
ALTER TABLE `vtiger_eventhandler_module`
  ADD PRIMARY KEY (`eventhandler_module_id`);

--
-- Indexes for table `vtiger_eventstatus`
--
ALTER TABLE `vtiger_eventstatus`
  ADD PRIMARY KEY (`eventstatusid`);

--
-- Indexes for table `vtiger_expectedresponse`
--
ALTER TABLE `vtiger_expectedresponse`
  ADD PRIMARY KEY (`expectedresponseid`),
  ADD UNIQUE KEY `CampaignExpRes_UK01` (`expectedresponse`);

--
-- Indexes for table `vtiger_faq`
--
ALTER TABLE `vtiger_faq`
  ADD PRIMARY KEY (`id`),
  ADD KEY `faq_id_idx` (`id`);

--
-- Indexes for table `vtiger_faqcategories`
--
ALTER TABLE `vtiger_faqcategories`
  ADD PRIMARY KEY (`faqcategories_id`);

--
-- Indexes for table `vtiger_faqcf`
--
ALTER TABLE `vtiger_faqcf`
  ADD PRIMARY KEY (`faqid`);

--
-- Indexes for table `vtiger_faqcomments`
--
ALTER TABLE `vtiger_faqcomments`
  ADD PRIMARY KEY (`commentid`),
  ADD KEY `faqcomments_faqid_idx` (`faqid`);

--
-- Indexes for table `vtiger_faqstatus`
--
ALTER TABLE `vtiger_faqstatus`
  ADD PRIMARY KEY (`faqstatus_id`);

--
-- Indexes for table `vtiger_field`
--
ALTER TABLE `vtiger_field`
  ADD PRIMARY KEY (`fieldid`),
  ADD KEY `field_tabid_idx` (`tabid`),
  ADD KEY `field_fieldname_idx` (`fieldname`),
  ADD KEY `field_block_idx` (`block`),
  ADD KEY `field_displaytype_idx` (`displaytype`);

--
-- Indexes for table `vtiger_freetagged_objects`
--
ALTER TABLE `vtiger_freetagged_objects`
  ADD PRIMARY KEY (`tag_id`,`tagger_id`,`object_id`),
  ADD KEY `freetagged_objects_tag_id_tagger_id_object_id_idx` (`tag_id`,`tagger_id`,`object_id`);

--
-- Indexes for table `vtiger_freetags`
--
ALTER TABLE `vtiger_freetags`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_gift_status`
--
ALTER TABLE `vtiger_gift_status`
  ADD PRIMARY KEY (`gift_statusid`);

--
-- Indexes for table `vtiger_glacct`
--
ALTER TABLE `vtiger_glacct`
  ADD PRIMARY KEY (`glacctid`),
  ADD UNIQUE KEY `glacct_glacct_idx` (`glacct`);

--
-- Indexes for table `vtiger_gooyagoals`
--
ALTER TABLE `vtiger_gooyagoals`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_goal` (`jyear`,`jmonth`,`userid`);

--
-- Indexes for table `vtiger_gooyanotes`
--
ALTER TABLE `vtiger_gooyanotes`
  ADD PRIMARY KEY (`gooyanotesid`);

--
-- Indexes for table `vtiger_gooyanotescf`
--
ALTER TABLE `vtiger_gooyanotescf`
  ADD PRIMARY KEY (`gooyanotesid`);

--
-- Indexes for table `vtiger_grant_status`
--
ALTER TABLE `vtiger_grant_status`
  ADD PRIMARY KEY (`grant_statusid`);

--
-- Indexes for table `vtiger_group2grouprel`
--
ALTER TABLE `vtiger_group2grouprel`
  ADD PRIMARY KEY (`groupid`,`containsgroupid`);

--
-- Indexes for table `vtiger_group2role`
--
ALTER TABLE `vtiger_group2role`
  ADD PRIMARY KEY (`groupid`,`roleid`),
  ADD KEY `fk_2_vtiger_group2role` (`roleid`);

--
-- Indexes for table `vtiger_group2rs`
--
ALTER TABLE `vtiger_group2rs`
  ADD PRIMARY KEY (`groupid`,`roleandsubid`),
  ADD KEY `fk_2_vtiger_group2rs` (`roleandsubid`);

--
-- Indexes for table `vtiger_groups`
--
ALTER TABLE `vtiger_groups`
  ADD PRIMARY KEY (`groupid`),
  ADD UNIQUE KEY `groups_groupname_idx` (`groupname`);

--
-- Indexes for table `vtiger_homedashbd`
--
ALTER TABLE `vtiger_homedashbd`
  ADD PRIMARY KEY (`stuffid`),
  ADD KEY `stuff_stuffid_idx` (`stuffid`);

--
-- Indexes for table `vtiger_homedefault`
--
ALTER TABLE `vtiger_homedefault`
  ADD PRIMARY KEY (`stuffid`),
  ADD KEY `stuff_stuffid_idx` (`stuffid`);

--
-- Indexes for table `vtiger_homemodule`
--
ALTER TABLE `vtiger_homemodule`
  ADD PRIMARY KEY (`stuffid`),
  ADD KEY `stuff_stuffid_idx` (`stuffid`);

--
-- Indexes for table `vtiger_homemoduleflds`
--
ALTER TABLE `vtiger_homemoduleflds`
  ADD KEY `stuff_stuffid_idx` (`stuffid`);

--
-- Indexes for table `vtiger_homereportchart`
--
ALTER TABLE `vtiger_homereportchart`
  ADD PRIMARY KEY (`stuffid`);

--
-- Indexes for table `vtiger_homerss`
--
ALTER TABLE `vtiger_homerss`
  ADD PRIMARY KEY (`stuffid`),
  ADD KEY `stuff_stuffid_idx` (`stuffid`);

--
-- Indexes for table `vtiger_homestuff`
--
ALTER TABLE `vtiger_homestuff`
  ADD PRIMARY KEY (`stuffid`),
  ADD KEY `stuff_stuffid_idx` (`stuffid`),
  ADD KEY `fk_1_vtiger_homestuff` (`userid`);

--
-- Indexes for table `vtiger_home_layout`
--
ALTER TABLE `vtiger_home_layout`
  ADD PRIMARY KEY (`userid`);

--
-- Indexes for table `vtiger_hour_format`
--
ALTER TABLE `vtiger_hour_format`
  ADD PRIMARY KEY (`hour_formatid`);

--
-- Indexes for table `vtiger_import_locks`
--
ALTER TABLE `vtiger_import_locks`
  ADD PRIMARY KEY (`vtiger_import_lock_id`);

--
-- Indexes for table `vtiger_import_maps`
--
ALTER TABLE `vtiger_import_maps`
  ADD PRIMARY KEY (`id`),
  ADD KEY `import_maps_assigned_user_id_module_name_deleted_idx` (`assigned_user_id`,`module`,`name`,`deleted`);

--
-- Indexes for table `vtiger_import_queue`
--
ALTER TABLE `vtiger_import_queue`
  ADD PRIMARY KEY (`importid`);

--
-- Indexes for table `vtiger_industry`
--
ALTER TABLE `vtiger_industry`
  ADD PRIMARY KEY (`industryid`),
  ADD UNIQUE KEY `industry_industry_idx` (`industry`);

--
-- Indexes for table `vtiger_inventorycharges`
--
ALTER TABLE `vtiger_inventorycharges`
  ADD PRIMARY KEY (`chargeid`);

--
-- Indexes for table `vtiger_inventorychargesrel`
--
ALTER TABLE `vtiger_inventorychargesrel`
  ADD KEY `record_idx` (`recordid`);

--
-- Indexes for table `vtiger_inventorynotification`
--
ALTER TABLE `vtiger_inventorynotification`
  ADD PRIMARY KEY (`notificationid`);

--
-- Indexes for table `vtiger_inventoryproductrel`
--
ALTER TABLE `vtiger_inventoryproductrel`
  ADD PRIMARY KEY (`lineitem_id`),
  ADD KEY `inventoryproductrel_id_idx` (`id`),
  ADD KEY `inventoryproductrel_productid_idx` (`productid`),
  ADD KEY `idx_sarv_inventory_record_sequence` (`id`,`sequence_no`,`lineitem_id`);

--
-- Indexes for table `vtiger_inventoryshippingrel`
--
ALTER TABLE `vtiger_inventoryshippingrel`
  ADD KEY `inventoryishippingrel_id_idx` (`id`);

--
-- Indexes for table `vtiger_inventorytaxinfo`
--
ALTER TABLE `vtiger_inventorytaxinfo`
  ADD PRIMARY KEY (`taxid`),
  ADD KEY `inventorytaxinfo_taxname_idx` (`taxname`);

--
-- Indexes for table `vtiger_inventory_tandc`
--
ALTER TABLE `vtiger_inventory_tandc`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_invitees`
--
ALTER TABLE `vtiger_invitees`
  ADD PRIMARY KEY (`activityid`,`inviteeid`);

--
-- Indexes for table `vtiger_invoice`
--
ALTER TABLE `vtiger_invoice`
  ADD PRIMARY KEY (`invoiceid`),
  ADD KEY `invoice_purchaseorderid_idx` (`invoiceid`),
  ADD KEY `fk_2_vtiger_invoice` (`salesorderid`),
  ADD KEY `idx_invoice_account` (`accountid`),
  ADD KEY `idx_invoice_contact` (`contactid`),
  ADD KEY `idx_invoice_potential` (`potential_id`);

--
-- Indexes for table `vtiger_invoicebillads`
--
ALTER TABLE `vtiger_invoicebillads`
  ADD PRIMARY KEY (`invoicebilladdressid`);

--
-- Indexes for table `vtiger_invoicecf`
--
ALTER TABLE `vtiger_invoicecf`
  ADD PRIMARY KEY (`invoiceid`),
  ADD KEY `idx_sarv_invoice_kind` (`cf_invoice_kind`,`invoiceid`);

--
-- Indexes for table `vtiger_invoiceshipads`
--
ALTER TABLE `vtiger_invoiceshipads`
  ADD PRIMARY KEY (`invoiceshipaddressid`);

--
-- Indexes for table `vtiger_invoicestatus`
--
ALTER TABLE `vtiger_invoicestatus`
  ADD PRIMARY KEY (`invoicestatusid`),
  ADD UNIQUE KEY `invoicestatus_invoiestatus_idx` (`invoicestatus`);

--
-- Indexes for table `vtiger_invoicestatushistory`
--
ALTER TABLE `vtiger_invoicestatushistory`
  ADD PRIMARY KEY (`historyid`),
  ADD KEY `invoicestatushistory_invoiceid_idx` (`invoiceid`);

--
-- Indexes for table `vtiger_invoice_recurring_info`
--
ALTER TABLE `vtiger_invoice_recurring_info`
  ADD PRIMARY KEY (`salesorderid`);

--
-- Indexes for table `vtiger_language`
--
ALTER TABLE `vtiger_language`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_leadaddress`
--
ALTER TABLE `vtiger_leadaddress`
  ADD PRIMARY KEY (`leadaddressid`);

--
-- Indexes for table `vtiger_leaddetails`
--
ALTER TABLE `vtiger_leaddetails`
  ADD PRIMARY KEY (`leadid`),
  ADD KEY `leaddetails_converted_leadstatus_idx` (`converted`,`leadstatus`),
  ADD KEY `email_idx` (`email`);

--
-- Indexes for table `vtiger_leadscf`
--
ALTER TABLE `vtiger_leadscf`
  ADD PRIMARY KEY (`leadid`);

--
-- Indexes for table `vtiger_leadsource`
--
ALTER TABLE `vtiger_leadsource`
  ADD PRIMARY KEY (`leadsourceid`);

--
-- Indexes for table `vtiger_leadstage`
--
ALTER TABLE `vtiger_leadstage`
  ADD PRIMARY KEY (`leadstageid`),
  ADD UNIQUE KEY `leadstage_stage_idx` (`stage`);

--
-- Indexes for table `vtiger_leadstatus`
--
ALTER TABLE `vtiger_leadstatus`
  ADD PRIMARY KEY (`leadstatusid`);

--
-- Indexes for table `vtiger_leadsubdetails`
--
ALTER TABLE `vtiger_leadsubdetails`
  ADD PRIMARY KEY (`leadsubscriptionid`);

--
-- Indexes for table `vtiger_lead_view`
--
ALTER TABLE `vtiger_lead_view`
  ADD PRIMARY KEY (`lead_viewid`);

--
-- Indexes for table `vtiger_links`
--
ALTER TABLE `vtiger_links`
  ADD PRIMARY KEY (`linkid`),
  ADD KEY `link_tabidtype_idx` (`tabid`,`linktype`);

--
-- Indexes for table `vtiger_list_status`
--
ALTER TABLE `vtiger_list_status`
  ADD PRIMARY KEY (`list_statusid`);

--
-- Indexes for table `vtiger_list_type`
--
ALTER TABLE `vtiger_list_type`
  ADD PRIMARY KEY (`list_typeid`);

--
-- Indexes for table `vtiger_location_status`
--
ALTER TABLE `vtiger_location_status`
  ADD PRIMARY KEY (`location_statusid`);

--
-- Indexes for table `vtiger_location_type`
--
ALTER TABLE `vtiger_location_type`
  ADD PRIMARY KEY (`location_typeid`);

--
-- Indexes for table `vtiger_loginhistory`
--
ALTER TABLE `vtiger_loginhistory`
  ADD PRIMARY KEY (`login_id`);

--
-- Indexes for table `vtiger_mailer_queue`
--
ALTER TABLE `vtiger_mailer_queue`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_mailmanager_mailattachments`
--
ALTER TABLE `vtiger_mailmanager_mailattachments`
  ADD KEY `userid_muid_idx` (`userid`,`muid`);

--
-- Indexes for table `vtiger_mailmanager_mailrecord`
--
ALTER TABLE `vtiger_mailmanager_mailrecord`
  ADD KEY `userid_lastsavedtime_idx` (`userid`,`lastsavedtime`),
  ADD KEY `userid_muid_idx` (`userid`,`muid`);

--
-- Indexes for table `vtiger_mailscanner_actions`
--
ALTER TABLE `vtiger_mailscanner_actions`
  ADD PRIMARY KEY (`actionid`);

--
-- Indexes for table `vtiger_mailscanner_folders`
--
ALTER TABLE `vtiger_mailscanner_folders`
  ADD PRIMARY KEY (`folderid`),
  ADD KEY `folderid_idx` (`folderid`);

--
-- Indexes for table `vtiger_mailscanner_ids`
--
ALTER TABLE `vtiger_mailscanner_ids`
  ADD KEY `scanner_message_ids_idx` (`scannerid`,`messageid`),
  ADD KEY `messageids_crmid_idx` (`crmid`);

--
-- Indexes for table `vtiger_mailscanner_rules`
--
ALTER TABLE `vtiger_mailscanner_rules`
  ADD PRIMARY KEY (`ruleid`);

--
-- Indexes for table `vtiger_manufacturer`
--
ALTER TABLE `vtiger_manufacturer`
  ADD PRIMARY KEY (`manufacturerid`),
  ADD UNIQUE KEY `manufacturer_manufacturer_idx` (`manufacturer`);

--
-- Indexes for table `vtiger_mobile_alerts`
--
ALTER TABLE `vtiger_mobile_alerts`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_modcomments`
--
ALTER TABLE `vtiger_modcomments`
  ADD KEY `relatedto_idx` (`related_to`),
  ADD KEY `fk_crmid_vtiger_modcomments` (`modcommentsid`);

--
-- Indexes for table `vtiger_modcommentscf`
--
ALTER TABLE `vtiger_modcommentscf`
  ADD PRIMARY KEY (`modcommentsid`);

--
-- Indexes for table `vtiger_modentity_num`
--
ALTER TABLE `vtiger_modentity_num`
  ADD PRIMARY KEY (`num_id`),
  ADD UNIQUE KEY `num_idx` (`num_id`),
  ADD KEY `semodule_active_idx` (`semodule`,`active`);

--
-- Indexes for table `vtiger_modtracker_basic`
--
ALTER TABLE `vtiger_modtracker_basic`
  ADD PRIMARY KEY (`id`),
  ADD KEY `crmidx` (`crmid`),
  ADD KEY `idx` (`id`),
  ADD KEY `idx_modtracker_crm_changed` (`crmid`,`changedon`);

--
-- Indexes for table `vtiger_modtracker_detail`
--
ALTER TABLE `vtiger_modtracker_detail`
  ADD KEY `idx` (`id`);

--
-- Indexes for table `vtiger_modtracker_relations`
--
ALTER TABLE `vtiger_modtracker_relations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_modtracker_tabs`
--
ALTER TABLE `vtiger_modtracker_tabs`
  ADD PRIMARY KEY (`tabid`);

--
-- Indexes for table `vtiger_module_dashboard_widgets`
--
ALTER TABLE `vtiger_module_dashboard_widgets`
  ADD PRIMARY KEY (`id`),
  ADD KEY `dashboardtabid` (`dashboardtabid`);

--
-- Indexes for table `vtiger_notes`
--
ALTER TABLE `vtiger_notes`
  ADD PRIMARY KEY (`notesid`),
  ADD KEY `notes_title_idx` (`title`),
  ADD KEY `notes_notesid_idx` (`notesid`);

--
-- Indexes for table `vtiger_notescf`
--
ALTER TABLE `vtiger_notescf`
  ADD PRIMARY KEY (`notesid`);

--
-- Indexes for table `vtiger_notificationscheduler`
--
ALTER TABLE `vtiger_notificationscheduler`
  ADD PRIMARY KEY (`schedulednotificationid`),
  ADD UNIQUE KEY `notificationscheduler_schedulednotificationname_idx` (`schedulednotificationname`);

--
-- Indexes for table `vtiger_no_of_currency_decimals`
--
ALTER TABLE `vtiger_no_of_currency_decimals`
  ADD PRIMARY KEY (`no_of_currency_decimalsid`);

--
-- Indexes for table `vtiger_opportunitystage`
--
ALTER TABLE `vtiger_opportunitystage`
  ADD PRIMARY KEY (`potstageid`),
  ADD UNIQUE KEY `opportunitystage_stage_idx` (`stage`);

--
-- Indexes for table `vtiger_opportunity_type`
--
ALTER TABLE `vtiger_opportunity_type`
  ADD PRIMARY KEY (`opptypeid`),
  ADD UNIQUE KEY `opportunity_type_opportunity_type_idx` (`opportunity_type`);

--
-- Indexes for table `vtiger_organizationdetails`
--
ALTER TABLE `vtiger_organizationdetails`
  ADD PRIMARY KEY (`organization_id`);

--
-- Indexes for table `vtiger_org_share_action2tab`
--
ALTER TABLE `vtiger_org_share_action2tab`
  ADD PRIMARY KEY (`share_action_id`,`tabid`),
  ADD KEY `fk_2_vtiger_org_share_action2tab` (`tabid`);

--
-- Indexes for table `vtiger_org_share_action_mapping`
--
ALTER TABLE `vtiger_org_share_action_mapping`
  ADD PRIMARY KEY (`share_action_id`);

--
-- Indexes for table `vtiger_othereventduration`
--
ALTER TABLE `vtiger_othereventduration`
  ADD PRIMARY KEY (`othereventdurationid`);

--
-- Indexes for table `vtiger_parenttab`
--
ALTER TABLE `vtiger_parenttab`
  ADD PRIMARY KEY (`parenttabid`),
  ADD KEY `parenttab_parenttabid_parenttabl_label_visible_idx` (`parenttabid`,`parenttab_label`,`visible`);

--
-- Indexes for table `vtiger_parenttabrel`
--
ALTER TABLE `vtiger_parenttabrel`
  ADD KEY `parenttabrel_tabid_parenttabid_idx` (`tabid`,`parenttabid`),
  ADD KEY `fk_2_vtiger_parenttabrel` (`parenttabid`);

--
-- Indexes for table `vtiger_participation_status`
--
ALTER TABLE `vtiger_participation_status`
  ADD PRIMARY KEY (`participation_statusid`);

--
-- Indexes for table `vtiger_participation_type`
--
ALTER TABLE `vtiger_participation_type`
  ADD PRIMARY KEY (`participation_typeid`);

--
-- Indexes for table `vtiger_payment_direction`
--
ALTER TABLE `vtiger_payment_direction`
  ADD PRIMARY KEY (`payment_directionid`);

--
-- Indexes for table `vtiger_payment_method`
--
ALTER TABLE `vtiger_payment_method`
  ADD PRIMARY KEY (`payment_methodid`);

--
-- Indexes for table `vtiger_payment_status`
--
ALTER TABLE `vtiger_payment_status`
  ADD PRIMARY KEY (`payment_statusid`);

--
-- Indexes for table `vtiger_payment_type`
--
ALTER TABLE `vtiger_payment_type`
  ADD PRIMARY KEY (`payment_typeid`);

--
-- Indexes for table `vtiger_pbxmanager`
--
ALTER TABLE `vtiger_pbxmanager`
  ADD PRIMARY KEY (`pbxmanagerid`),
  ADD KEY `index_sourceuuid` (`sourceuuid`),
  ADD KEY `index_pbxmanager_id` (`pbxmanagerid`),
  ADD KEY `idx_pbxmanager_account` (`customer`);

--
-- Indexes for table `vtiger_pbxmanagercf`
--
ALTER TABLE `vtiger_pbxmanagercf`
  ADD PRIMARY KEY (`pbxmanagerid`);

--
-- Indexes for table `vtiger_pbxmanager_gateway`
--
ALTER TABLE `vtiger_pbxmanager_gateway`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_pbxmanager_phonelookup`
--
ALTER TABLE `vtiger_pbxmanager_phonelookup`
  ADD UNIQUE KEY `unique_key` (`crmid`,`setype`,`fieldname`),
  ADD KEY `index_phone_number` (`fnumber`,`rnumber`);

--
-- Indexes for table `vtiger_picklist`
--
ALTER TABLE `vtiger_picklist`
  ADD PRIMARY KEY (`picklistid`),
  ADD UNIQUE KEY `picklist_name_idx` (`name`);

--
-- Indexes for table `vtiger_picklist_dependency`
--
ALTER TABLE `vtiger_picklist_dependency`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_picklist_transitions`
--
ALTER TABLE `vtiger_picklist_transitions`
  ADD PRIMARY KEY (`fieldname`);

--
-- Indexes for table `vtiger_pobillads`
--
ALTER TABLE `vtiger_pobillads`
  ADD PRIMARY KEY (`pobilladdressid`);

--
-- Indexes for table `vtiger_portal`
--
ALTER TABLE `vtiger_portal`
  ADD PRIMARY KEY (`portalid`),
  ADD KEY `portal_portalname_idx` (`portalname`);

--
-- Indexes for table `vtiger_poshipads`
--
ALTER TABLE `vtiger_poshipads`
  ADD PRIMARY KEY (`poshipaddressid`);

--
-- Indexes for table `vtiger_postatus`
--
ALTER TABLE `vtiger_postatus`
  ADD PRIMARY KEY (`postatusid`),
  ADD UNIQUE KEY `postatus_postatus_idx` (`postatus`);

--
-- Indexes for table `vtiger_postatushistory`
--
ALTER TABLE `vtiger_postatushistory`
  ADD PRIMARY KEY (`historyid`),
  ADD KEY `postatushistory_purchaseorderid_idx` (`purchaseorderid`);

--
-- Indexes for table `vtiger_potential`
--
ALTER TABLE `vtiger_potential`
  ADD PRIMARY KEY (`potentialid`),
  ADD KEY `potential_relatedto_idx` (`related_to`),
  ADD KEY `potentail_sales_stage_idx` (`sales_stage`),
  ADD KEY `potentail_sales_stage_amount_idx` (`amount`,`sales_stage`),
  ADD KEY `idx_potential_contact` (`contact_id`);

--
-- Indexes for table `vtiger_potentialscf`
--
ALTER TABLE `vtiger_potentialscf`
  ADD PRIMARY KEY (`potentialid`);

--
-- Indexes for table `vtiger_potstagehistory`
--
ALTER TABLE `vtiger_potstagehistory`
  ADD PRIMARY KEY (`historyid`),
  ADD KEY `potstagehistory_potentialid_idx` (`potentialid`);

--
-- Indexes for table `vtiger_pricebook`
--
ALTER TABLE `vtiger_pricebook`
  ADD PRIMARY KEY (`pricebookid`);

--
-- Indexes for table `vtiger_pricebookcf`
--
ALTER TABLE `vtiger_pricebookcf`
  ADD PRIMARY KEY (`pricebookid`);

--
-- Indexes for table `vtiger_pricebookproductrel`
--
ALTER TABLE `vtiger_pricebookproductrel`
  ADD PRIMARY KEY (`pricebookid`,`productid`),
  ADD KEY `pricebookproductrel_pricebookid_idx` (`pricebookid`),
  ADD KEY `pricebookproductrel_productid_idx` (`productid`);

--
-- Indexes for table `vtiger_priority`
--
ALTER TABLE `vtiger_priority`
  ADD PRIMARY KEY (`priorityid`),
  ADD UNIQUE KEY `priority_priority_idx` (`priority`);

--
-- Indexes for table `vtiger_productcategory`
--
ALTER TABLE `vtiger_productcategory`
  ADD PRIMARY KEY (`productcategoryid`),
  ADD UNIQUE KEY `productcategory_productcategory_idx` (`productcategory`);

--
-- Indexes for table `vtiger_productcf`
--
ALTER TABLE `vtiger_productcf`
  ADD PRIMARY KEY (`productid`);

--
-- Indexes for table `vtiger_products`
--
ALTER TABLE `vtiger_products`
  ADD PRIMARY KEY (`productid`);

--
-- Indexes for table `vtiger_producttaxrel`
--
ALTER TABLE `vtiger_producttaxrel`
  ADD KEY `producttaxrel_productid_idx` (`productid`),
  ADD KEY `producttaxrel_taxid_idx` (`taxid`);

--
-- Indexes for table `vtiger_profile`
--
ALTER TABLE `vtiger_profile`
  ADD PRIMARY KEY (`profileid`);

--
-- Indexes for table `vtiger_profile2field`
--
ALTER TABLE `vtiger_profile2field`
  ADD PRIMARY KEY (`profileid`,`fieldid`),
  ADD KEY `profile2field_profileid_tabid_fieldname_idx` (`profileid`,`tabid`),
  ADD KEY `profile2field_tabid_profileid_idx` (`tabid`,`profileid`),
  ADD KEY `profile2field_visible_profileid_idx` (`visible`,`profileid`);

--
-- Indexes for table `vtiger_profile2globalpermissions`
--
ALTER TABLE `vtiger_profile2globalpermissions`
  ADD PRIMARY KEY (`profileid`,`globalactionid`),
  ADD KEY `idx_profile2globalpermissions` (`profileid`,`globalactionid`);

--
-- Indexes for table `vtiger_profile2standardpermissions`
--
ALTER TABLE `vtiger_profile2standardpermissions`
  ADD PRIMARY KEY (`profileid`,`tabid`,`operation`),
  ADD KEY `profile2standardpermissions_profileid_tabid_operation_idx` (`profileid`,`tabid`,`operation`);

--
-- Indexes for table `vtiger_profile2tab`
--
ALTER TABLE `vtiger_profile2tab`
  ADD KEY `profile2tab_profileid_tabid_idx` (`profileid`,`tabid`);

--
-- Indexes for table `vtiger_profile2utility`
--
ALTER TABLE `vtiger_profile2utility`
  ADD PRIMARY KEY (`profileid`,`tabid`,`activityid`),
  ADD KEY `profile2utility_profileid_tabid_activityid_idx` (`profileid`,`tabid`,`activityid`);

--
-- Indexes for table `vtiger_progress`
--
ALTER TABLE `vtiger_progress`
  ADD PRIMARY KEY (`progressid`);

--
-- Indexes for table `vtiger_project`
--
ALTER TABLE `vtiger_project`
  ADD PRIMARY KEY (`projectid`),
  ADD KEY `idx_project_account` (`linktoaccountscontacts`),
  ADD KEY `idx_project_potential` (`potentialid`);

--
-- Indexes for table `vtiger_projectcf`
--
ALTER TABLE `vtiger_projectcf`
  ADD PRIMARY KEY (`projectid`);

--
-- Indexes for table `vtiger_projectmilestone`
--
ALTER TABLE `vtiger_projectmilestone`
  ADD PRIMARY KEY (`projectmilestoneid`);

--
-- Indexes for table `vtiger_projectmilestonecf`
--
ALTER TABLE `vtiger_projectmilestonecf`
  ADD PRIMARY KEY (`projectmilestoneid`);

--
-- Indexes for table `vtiger_projectmilestonetype`
--
ALTER TABLE `vtiger_projectmilestonetype`
  ADD PRIMARY KEY (`projectmilestonetypeid`);

--
-- Indexes for table `vtiger_projectpriority`
--
ALTER TABLE `vtiger_projectpriority`
  ADD PRIMARY KEY (`projectpriorityid`);

--
-- Indexes for table `vtiger_projectstatus`
--
ALTER TABLE `vtiger_projectstatus`
  ADD PRIMARY KEY (`projectstatusid`);

--
-- Indexes for table `vtiger_projecttask`
--
ALTER TABLE `vtiger_projecttask`
  ADD PRIMARY KEY (`projecttaskid`);

--
-- Indexes for table `vtiger_projecttaskcf`
--
ALTER TABLE `vtiger_projecttaskcf`
  ADD PRIMARY KEY (`projecttaskid`);

--
-- Indexes for table `vtiger_projecttaskpriority`
--
ALTER TABLE `vtiger_projecttaskpriority`
  ADD PRIMARY KEY (`projecttaskpriorityid`);

--
-- Indexes for table `vtiger_projecttaskprogress`
--
ALTER TABLE `vtiger_projecttaskprogress`
  ADD PRIMARY KEY (`projecttaskprogressid`);

--
-- Indexes for table `vtiger_projecttaskstatus`
--
ALTER TABLE `vtiger_projecttaskstatus`
  ADD PRIMARY KEY (`projecttaskstatusid`);

--
-- Indexes for table `vtiger_projecttasktype`
--
ALTER TABLE `vtiger_projecttasktype`
  ADD PRIMARY KEY (`projecttasktypeid`);

--
-- Indexes for table `vtiger_projecttask_status_color`
--
ALTER TABLE `vtiger_projecttask_status_color`
  ADD UNIQUE KEY `status` (`status`);

--
-- Indexes for table `vtiger_projecttype`
--
ALTER TABLE `vtiger_projecttype`
  ADD PRIMARY KEY (`projecttypeid`);

--
-- Indexes for table `vtiger_purchaseorder`
--
ALTER TABLE `vtiger_purchaseorder`
  ADD PRIMARY KEY (`purchaseorderid`),
  ADD KEY `purchaseorder_vendorid_idx` (`vendorid`),
  ADD KEY `purchaseorder_quoteid_idx` (`quoteid`),
  ADD KEY `purchaseorder_contactid_idx` (`contactid`),
  ADD KEY `idx_sarv_purchaseorder_account` (`accountid`,`postatus`,`duedate`),
  ADD KEY `idx_sarv_purchaseorder_contact` (`contactid`);

--
-- Indexes for table `vtiger_purchaseordercf`
--
ALTER TABLE `vtiger_purchaseordercf`
  ADD PRIMARY KEY (`purchaseorderid`);

--
-- Indexes for table `vtiger_quotes`
--
ALTER TABLE `vtiger_quotes`
  ADD PRIMARY KEY (`quoteid`),
  ADD KEY `quote_quotestage_idx` (`quotestage`),
  ADD KEY `quotes_potentialid_idx` (`potentialid`),
  ADD KEY `quotes_contactid_idx` (`contactid`),
  ADD KEY `idx_quotes_account` (`accountid`);

--
-- Indexes for table `vtiger_quotesbillads`
--
ALTER TABLE `vtiger_quotesbillads`
  ADD PRIMARY KEY (`quotebilladdressid`);

--
-- Indexes for table `vtiger_quotescf`
--
ALTER TABLE `vtiger_quotescf`
  ADD PRIMARY KEY (`quoteid`);

--
-- Indexes for table `vtiger_quotesshipads`
--
ALTER TABLE `vtiger_quotesshipads`
  ADD PRIMARY KEY (`quoteshipaddressid`);

--
-- Indexes for table `vtiger_quotestage`
--
ALTER TABLE `vtiger_quotestage`
  ADD PRIMARY KEY (`quotestageid`),
  ADD UNIQUE KEY `quotestage_quotestage_idx` (`quotestage`);

--
-- Indexes for table `vtiger_quotestagehistory`
--
ALTER TABLE `vtiger_quotestagehistory`
  ADD PRIMARY KEY (`historyid`),
  ADD KEY `quotestagehistory_quoteid_idx` (`quoteid`);

--
-- Indexes for table `vtiger_rating`
--
ALTER TABLE `vtiger_rating`
  ADD PRIMARY KEY (`rating_id`);

--
-- Indexes for table `vtiger_recurringevents`
--
ALTER TABLE `vtiger_recurringevents`
  ADD PRIMARY KEY (`recurringid`),
  ADD KEY `fk_1_vtiger_recurringevents` (`activityid`);

--
-- Indexes for table `vtiger_recurringtype`
--
ALTER TABLE `vtiger_recurringtype`
  ADD PRIMARY KEY (`recurringeventid`),
  ADD UNIQUE KEY `recurringtype_status_idx` (`recurringtype`);

--
-- Indexes for table `vtiger_relatedlists`
--
ALTER TABLE `vtiger_relatedlists`
  ADD PRIMARY KEY (`relation_id`),
  ADD KEY `relatedlists_relation_id_idx` (`relation_id`);

--
-- Indexes for table `vtiger_relcriteria`
--
ALTER TABLE `vtiger_relcriteria`
  ADD PRIMARY KEY (`queryid`,`columnindex`),
  ADD KEY `relcriteria_queryid_idx` (`queryid`);

--
-- Indexes for table `vtiger_relcriteria_grouping`
--
ALTER TABLE `vtiger_relcriteria_grouping`
  ADD PRIMARY KEY (`groupid`,`queryid`);

--
-- Indexes for table `vtiger_reminder_interval`
--
ALTER TABLE `vtiger_reminder_interval`
  ADD PRIMARY KEY (`reminder_intervalid`);

--
-- Indexes for table `vtiger_report`
--
ALTER TABLE `vtiger_report`
  ADD PRIMARY KEY (`reportid`),
  ADD KEY `report_queryid_idx` (`queryid`),
  ADD KEY `report_folderid_idx` (`folderid`);

--
-- Indexes for table `vtiger_reportdatefilter`
--
ALTER TABLE `vtiger_reportdatefilter`
  ADD PRIMARY KEY (`datefilterid`),
  ADD KEY `reportdatefilter_datefilterid_idx` (`datefilterid`);

--
-- Indexes for table `vtiger_reportfolder`
--
ALTER TABLE `vtiger_reportfolder`
  ADD PRIMARY KEY (`folderid`);

--
-- Indexes for table `vtiger_reportgroupbycolumn`
--
ALTER TABLE `vtiger_reportgroupbycolumn`
  ADD KEY `fk_1_vtiger_reportgroupbycolumn` (`reportid`);

--
-- Indexes for table `vtiger_reportmodules`
--
ALTER TABLE `vtiger_reportmodules`
  ADD PRIMARY KEY (`reportmodulesid`);

--
-- Indexes for table `vtiger_reportsortcol`
--
ALTER TABLE `vtiger_reportsortcol`
  ADD PRIMARY KEY (`sortcolid`,`reportid`),
  ADD KEY `fk_1_vtiger_reportsortcol` (`reportid`);

--
-- Indexes for table `vtiger_reportsummary`
--
ALTER TABLE `vtiger_reportsummary`
  ADD PRIMARY KEY (`reportsummaryid`,`summarytype`,`columnname`),
  ADD KEY `reportsummary_reportsummaryid_idx` (`reportsummaryid`);

--
-- Indexes for table `vtiger_reporttype`
--
ALTER TABLE `vtiger_reporttype`
  ADD PRIMARY KEY (`reportid`);

--
-- Indexes for table `vtiger_report_sharegroups`
--
ALTER TABLE `vtiger_report_sharegroups`
  ADD KEY `vtiger_report_sharegroups_ibfk_1` (`reportid`),
  ADD KEY `vtiger_groups_groupid_ibfk_1` (`groupid`);

--
-- Indexes for table `vtiger_report_sharerole`
--
ALTER TABLE `vtiger_report_sharerole`
  ADD KEY `vtiger_report_sharerole_ibfk_1` (`reportid`),
  ADD KEY `vtiger_role_roleid_ibfk_1` (`roleid`);

--
-- Indexes for table `vtiger_report_sharers`
--
ALTER TABLE `vtiger_report_sharers`
  ADD KEY `vtiger_report_sharers_ibfk_1` (`reportid`),
  ADD KEY `vtiger_rolesd_rsid_ibfk_1` (`rsid`);

--
-- Indexes for table `vtiger_report_shareusers`
--
ALTER TABLE `vtiger_report_shareusers`
  ADD KEY `vtiger_report_shareusers_ibfk_1` (`reportid`),
  ADD KEY `vtiger_users_userid_ibfk_1` (`userid`);

--
-- Indexes for table `vtiger_reservation_status`
--
ALTER TABLE `vtiger_reservation_status`
  ADD PRIMARY KEY (`reservation_statusid`);

--
-- Indexes for table `vtiger_response_status`
--
ALTER TABLE `vtiger_response_status`
  ADD PRIMARY KEY (`response_statusid`);

--
-- Indexes for table `vtiger_role`
--
ALTER TABLE `vtiger_role`
  ADD PRIMARY KEY (`roleid`);

--
-- Indexes for table `vtiger_role2picklist`
--
ALTER TABLE `vtiger_role2picklist`
  ADD PRIMARY KEY (`roleid`,`picklistvalueid`,`picklistid`),
  ADD KEY `role2picklist_roleid_picklistid_idx` (`roleid`,`picklistid`,`picklistvalueid`),
  ADD KEY `fk_2_vtiger_role2picklist` (`picklistid`);

--
-- Indexes for table `vtiger_role2profile`
--
ALTER TABLE `vtiger_role2profile`
  ADD PRIMARY KEY (`roleid`,`profileid`),
  ADD KEY `role2profile_roleid_profileid_idx` (`roleid`,`profileid`);

--
-- Indexes for table `vtiger_rollupcomments_settings`
--
ALTER TABLE `vtiger_rollupcomments_settings`
  ADD PRIMARY KEY (`rollupid`);

--
-- Indexes for table `vtiger_rowheight`
--
ALTER TABLE `vtiger_rowheight`
  ADD PRIMARY KEY (`rowheightid`);

--
-- Indexes for table `vtiger_rss`
--
ALTER TABLE `vtiger_rss`
  ADD PRIMARY KEY (`rssid`);

--
-- Indexes for table `vtiger_salesmanactivityrel`
--
ALTER TABLE `vtiger_salesmanactivityrel`
  ADD PRIMARY KEY (`smid`,`activityid`),
  ADD KEY `salesmanactivityrel_activityid_idx` (`activityid`),
  ADD KEY `salesmanactivityrel_smid_idx` (`smid`);

--
-- Indexes for table `vtiger_salesmanattachmentsrel`
--
ALTER TABLE `vtiger_salesmanattachmentsrel`
  ADD PRIMARY KEY (`smid`,`attachmentsid`),
  ADD KEY `salesmanattachmentsrel_smid_idx` (`smid`),
  ADD KEY `salesmanattachmentsrel_attachmentsid_idx` (`attachmentsid`);

--
-- Indexes for table `vtiger_salesmanticketrel`
--
ALTER TABLE `vtiger_salesmanticketrel`
  ADD PRIMARY KEY (`smid`,`id`),
  ADD KEY `salesmanticketrel_smid_idx` (`smid`),
  ADD KEY `salesmanticketrel_id_idx` (`id`);

--
-- Indexes for table `vtiger_salesorder`
--
ALTER TABLE `vtiger_salesorder`
  ADD PRIMARY KEY (`salesorderid`),
  ADD KEY `salesorder_vendorid_idx` (`vendorid`),
  ADD KEY `salesorder_contactid_idx` (`contactid`),
  ADD KEY `idx_salesorder_account` (`accountid`),
  ADD KEY `idx_salesorder_potential` (`potentialid`),
  ADD KEY `idx_salesorder_quote` (`quoteid`);

--
-- Indexes for table `vtiger_salesordercf`
--
ALTER TABLE `vtiger_salesordercf`
  ADD PRIMARY KEY (`salesorderid`);

--
-- Indexes for table `vtiger_sales_channel`
--
ALTER TABLE `vtiger_sales_channel`
  ADD PRIMARY KEY (`sales_channelid`);

--
-- Indexes for table `vtiger_sales_stage`
--
ALTER TABLE `vtiger_sales_stage`
  ADD PRIMARY KEY (`sales_stage_id`);

--
-- Indexes for table `vtiger_salutationtype`
--
ALTER TABLE `vtiger_salutationtype`
  ADD PRIMARY KEY (`salutationid`);

--
-- Indexes for table `vtiger_sample_status`
--
ALTER TABLE `vtiger_sample_status`
  ADD PRIMARY KEY (`sample_statusid`);

--
-- Indexes for table `vtiger_sarvaccessgrants`
--
ALTER TABLE `vtiger_sarvaccessgrants`
  ADD PRIMARY KEY (`sarvaccessgrantsid`),
  ADD UNIQUE KEY `uq_sarvaccessgrants_no` (`grant_no`),
  ADD KEY `idx_sarvgrant_account_group_status` (`accountid`,`groupid`,`grant_status`),
  ADD KEY `idx_sarvgrant_group_effective` (`groupid`,`grant_status`,`valid_from`,`valid_to`,`access_level`);

--
-- Indexes for table `vtiger_sarvaccessgrantscf`
--
ALTER TABLE `vtiger_sarvaccessgrantscf`
  ADD PRIMARY KEY (`sarvaccessgrantsid`);

--
-- Indexes for table `vtiger_sarvbankaccountscf`
--
ALTER TABLE `vtiger_sarvbankaccountscf`
  ADD PRIMARY KEY (`sarvbankaccountsid`);

--
-- Indexes for table `vtiger_sarvbusinesslocations`
--
ALTER TABLE `vtiger_sarvbusinesslocations`
  ADD PRIMARY KEY (`sarvbusinesslocationsid`),
  ADD UNIQUE KEY `uq_sarvbusinesslocations_no` (`location_no`),
  ADD KEY `idx_sarvlocation_account_type_status` (`accountid`,`location_type`,`location_status`),
  ADD KEY `idx_sarvlocation_parent` (`parentlocationid`),
  ADD KEY `idx_sarvlocation_manager` (`managercontactid`),
  ADD KEY `idx_sarvlocation_geo` (`latitude`,`longitude`);

--
-- Indexes for table `vtiger_sarvbusinesslocationscf`
--
ALTER TABLE `vtiger_sarvbusinesslocationscf`
  ADD PRIMARY KEY (`sarvbusinesslocationsid`);

--
-- Indexes for table `vtiger_sarvdeposits`
--
ALTER TABLE `vtiger_sarvdeposits`
  ADD PRIMARY KEY (`sarvdepositsid`),
  ADD UNIQUE KEY `uq_sarvdeposits_no` (`deposit_no`),
  ADD KEY `idx_sarvdeposit_account_status` (`accountid`,`deposit_status`,`expiry_date`),
  ADD KEY `idx_sarvdeposit_payment` (`paymentid`),
  ADD KEY `idx_sarvdeposit_contact` (`contactid`),
  ADD KEY `idx_sarvdeposit_related` (`relatedto`),
  ADD KEY `fk_sarvdeposits_currency` (`currency_id`);

--
-- Indexes for table `vtiger_sarvdepositscf`
--
ALTER TABLE `vtiger_sarvdepositscf`
  ADD PRIMARY KEY (`sarvdepositsid`);

--
-- Indexes for table `vtiger_sarvgifts`
--
ALTER TABLE `vtiger_sarvgifts`
  ADD PRIMARY KEY (`sarvgiftsid`),
  ADD UNIQUE KEY `uq_sarvgifts_no` (`gift_no`),
  ADD KEY `idx_sarvgift_account_status_date` (`accountid`,`gift_status`,`request_date`),
  ADD KEY `idx_sarvgift_contactid` (`contactid`),
  ADD KEY `idx_sarvgift_campaignid` (`campaignid`),
  ADD KEY `idx_sarvgift_productid` (`productid`);

--
-- Indexes for table `vtiger_sarvgiftscf`
--
ALTER TABLE `vtiger_sarvgiftscf`
  ADD PRIMARY KEY (`sarvgiftsid`);

--
-- Indexes for table `vtiger_sarvparticipations`
--
ALTER TABLE `vtiger_sarvparticipations`
  ADD PRIMARY KEY (`sarvparticipationsid`),
  ADD UNIQUE KEY `uq_sarvparticipations_no` (`participation_no`),
  ADD KEY `idx_sarvparticipations_account_status` (`accountid`,`participation_status`,`start_date`),
  ADD KEY `idx_sarvparticipations_contact` (`contactid`);

--
-- Indexes for table `vtiger_sarvparticipationscf`
--
ALTER TABLE `vtiger_sarvparticipationscf`
  ADD PRIMARY KEY (`sarvparticipationsid`);

--
-- Indexes for table `vtiger_sarvpayments`
--
ALTER TABLE `vtiger_sarvpayments`
  ADD PRIMARY KEY (`sarvpaymentsid`),
  ADD UNIQUE KEY `uq_sarvpayments_no` (`payment_no`),
  ADD UNIQUE KEY `idx_sarvpayments_idempotency` (`idempotency_key`),
  ADD UNIQUE KEY `idx_sarvpayments_legacy` (`legacy_source`,`legacy_id`),
  ADD KEY `idx_sarvpayments_account_status_date` (`accountid`,`payment_status`,`payment_date`);

--
-- Indexes for table `vtiger_sarvpaymentscf`
--
ALTER TABLE `vtiger_sarvpaymentscf`
  ADD PRIMARY KEY (`sarvpaymentsid`);

--
-- Indexes for table `vtiger_sarvproductsamples`
--
ALTER TABLE `vtiger_sarvproductsamples`
  ADD PRIMARY KEY (`sarvproductsamplesid`),
  ADD UNIQUE KEY `uq_sarvproductsamples_no` (`sample_no`),
  ADD KEY `idx_sarvsample_account_status_date` (`accountid`,`sample_status`,`request_date`),
  ADD KEY `idx_sarvsample_contactid` (`contactid`),
  ADD KEY `idx_sarvsample_potentialid` (`potentialid`),
  ADD KEY `idx_sarvsample_campaignid` (`campaignid`),
  ADD KEY `idx_sarvsample_productid` (`productid`);

--
-- Indexes for table `vtiger_sarvproductsamplescf`
--
ALTER TABLE `vtiger_sarvproductsamplescf`
  ADD PRIMARY KEY (`sarvproductsamplesid`);

--
-- Indexes for table `vtiger_sarvsalescontracts`
--
ALTER TABLE `vtiger_sarvsalescontracts`
  ADD PRIMARY KEY (`sarvsalescontractsid`),
  ADD UNIQUE KEY `uq_sarvsalescontracts_no` (`contract_no`),
  ADD KEY `idx_sarvsalescontract_account_status` (`accountid`,`contract_status`,`end_date`),
  ADD KEY `idx_sarvsalescontract_contactid` (`contactid`),
  ADD KEY `idx_sarvsalescontract_potentialid` (`potentialid`),
  ADD KEY `idx_sarvsalescontract_quoteid` (`quoteid`),
  ADD KEY `idx_sarvsalescontract_salesorderid` (`salesorderid`);

--
-- Indexes for table `vtiger_sarvsalescontractscf`
--
ALTER TABLE `vtiger_sarvsalescontractscf`
  ADD PRIMARY KEY (`sarvsalescontractsid`);

--
-- Indexes for table `vtiger_sarvsurveyresponses`
--
ALTER TABLE `vtiger_sarvsurveyresponses`
  ADD PRIMARY KEY (`sarvsurveyresponsesid`),
  ADD UNIQUE KEY `uq_sarvsurveyresponses_no` (`response_no`),
  ADD KEY `idx_sarvsurvey_account_status` (`accountid`,`response_status`,`submitted_at`),
  ADD KEY `idx_sarvsurvey_contact` (`contactid`);

--
-- Indexes for table `vtiger_sarvsurveyresponsescf`
--
ALTER TABLE `vtiger_sarvsurveyresponsescf`
  ADD PRIMARY KEY (`sarvsurveyresponsesid`);

--
-- Indexes for table `vtiger_sarvtargetlists`
--
ALTER TABLE `vtiger_sarvtargetlists`
  ADD PRIMARY KEY (`sarvtargetlistsid`),
  ADD UNIQUE KEY `uq_sarvtargetlists_no` (`targetlist_no`),
  ADD KEY `idx_sarvtargetlist_account_status` (`accountid`,`list_status`,`valid_to`);

--
-- Indexes for table `vtiger_sarvtargetlistscf`
--
ALTER TABLE `vtiger_sarvtargetlistscf`
  ADD PRIMARY KEY (`sarvtargetlistsid`);

--
-- Indexes for table `vtiger_sarvtimereservationscf`
--
ALTER TABLE `vtiger_sarvtimereservationscf`
  ADD PRIMARY KEY (`sarvtimereservationsid`);

--
-- Indexes for table `vtiger_sarv_delivery_format`
--
ALTER TABLE `vtiger_sarv_delivery_format`
  ADD PRIMARY KEY (`sarv_delivery_formatid`);

--
-- Indexes for table `vtiger_sarv_otp`
--
ALTER TABLE `vtiger_sarv_otp`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_mobile` (`mobile`),
  ADD KEY `idx_expires` (`expires_at`),
  ADD KEY `idx_purpose_user` (`purpose`,`userid`,`created_at`),
  ADD KEY `idx_context_hash` (`context_hash`);

--
-- Indexes for table `vtiger_sarv_payment_method`
--
ALTER TABLE `vtiger_sarv_payment_method`
  ADD PRIMARY KEY (`sarv_payment_methodid`);

--
-- Indexes for table `vtiger_sarv_payment_status`
--
ALTER TABLE `vtiger_sarv_payment_status`
  ADD PRIMARY KEY (`sarv_payment_statusid`);

--
-- Indexes for table `vtiger_sarv_po_category`
--
ALTER TABLE `vtiger_sarv_po_category`
  ADD PRIMARY KEY (`sarv_po_categoryid`);

--
-- Indexes for table `vtiger_sarv_print_template`
--
ALTER TABLE `vtiger_sarv_print_template`
  ADD PRIMARY KEY (`sarv_print_templateid`);

--
-- Indexes for table `vtiger_sarv_shipping_method`
--
ALTER TABLE `vtiger_sarv_shipping_method`
  ADD PRIMARY KEY (`sarv_shipping_methodid`);

--
-- Indexes for table `vtiger_sarv_sms_reminder`
--
ALTER TABLE `vtiger_sarv_sms_reminder`
  ADD PRIMARY KEY (`sarv_sms_reminderid`);

--
-- Indexes for table `vtiger_scheduled_reports`
--
ALTER TABLE `vtiger_scheduled_reports`
  ADD PRIMARY KEY (`reportid`);

--
-- Indexes for table `vtiger_seactivityrel`
--
ALTER TABLE `vtiger_seactivityrel`
  ADD PRIMARY KEY (`crmid`,`activityid`),
  ADD KEY `seactivityrel_activityid_idx` (`activityid`),
  ADD KEY `seactivityrel_crmid_idx` (`crmid`);

--
-- Indexes for table `vtiger_seattachmentsrel`
--
ALTER TABLE `vtiger_seattachmentsrel`
  ADD PRIMARY KEY (`crmid`,`attachmentsid`),
  ADD KEY `seattachmentsrel_attachmentsid_idx` (`attachmentsid`),
  ADD KEY `seattachmentsrel_crmid_idx` (`crmid`),
  ADD KEY `seattachmentsrel_attachmentsid_crmid_idx` (`attachmentsid`,`crmid`);

--
-- Indexes for table `vtiger_selectcolumn`
--
ALTER TABLE `vtiger_selectcolumn`
  ADD PRIMARY KEY (`queryid`,`columnindex`),
  ADD KEY `selectcolumn_queryid_idx` (`queryid`);

--
-- Indexes for table `vtiger_selectquery`
--
ALTER TABLE `vtiger_selectquery`
  ADD PRIMARY KEY (`queryid`),
  ADD KEY `selectquery_queryid_idx` (`queryid`);

--
-- Indexes for table `vtiger_senotesrel`
--
ALTER TABLE `vtiger_senotesrel`
  ADD PRIMARY KEY (`crmid`,`notesid`),
  ADD KEY `senotesrel_notesid_idx` (`notesid`),
  ADD KEY `senotesrel_crmid_idx` (`crmid`);

--
-- Indexes for table `vtiger_seproductsrel`
--
ALTER TABLE `vtiger_seproductsrel`
  ADD PRIMARY KEY (`crmid`,`productid`),
  ADD KEY `seproductsrel_productid_idx` (`productid`),
  ADD KEY `seproductrel_crmid_idx` (`crmid`);

--
-- Indexes for table `vtiger_service`
--
ALTER TABLE `vtiger_service`
  ADD PRIMARY KEY (`serviceid`);

--
-- Indexes for table `vtiger_servicecategory`
--
ALTER TABLE `vtiger_servicecategory`
  ADD PRIMARY KEY (`servicecategoryid`);

--
-- Indexes for table `vtiger_servicecf`
--
ALTER TABLE `vtiger_servicecf`
  ADD PRIMARY KEY (`serviceid`);

--
-- Indexes for table `vtiger_servicecontracts`
--
ALTER TABLE `vtiger_servicecontracts`
  ADD KEY `fk_crmid_vtiger_servicecontracts` (`servicecontractsid`),
  ADD KEY `idx_servicecontracts_account` (`sc_related_to`);

--
-- Indexes for table `vtiger_servicecontractscf`
--
ALTER TABLE `vtiger_servicecontractscf`
  ADD PRIMARY KEY (`servicecontractsid`);

--
-- Indexes for table `vtiger_service_usageunit`
--
ALTER TABLE `vtiger_service_usageunit`
  ADD PRIMARY KEY (`service_usageunitid`);

--
-- Indexes for table `vtiger_seticketsrel`
--
ALTER TABLE `vtiger_seticketsrel`
  ADD PRIMARY KEY (`crmid`,`ticketid`),
  ADD KEY `seticketsrel_crmid_idx` (`crmid`),
  ADD KEY `seticketsrel_ticketid_idx` (`ticketid`);

--
-- Indexes for table `vtiger_settings_blocks`
--
ALTER TABLE `vtiger_settings_blocks`
  ADD PRIMARY KEY (`blockid`);

--
-- Indexes for table `vtiger_settings_field`
--
ALTER TABLE `vtiger_settings_field`
  ADD PRIMARY KEY (`fieldid`),
  ADD KEY `fk_1_vtiger_settings_field` (`blockid`);

--
-- Indexes for table `vtiger_sharedcalendar`
--
ALTER TABLE `vtiger_sharedcalendar`
  ADD PRIMARY KEY (`userid`,`sharedid`);

--
-- Indexes for table `vtiger_shippingtaxinfo`
--
ALTER TABLE `vtiger_shippingtaxinfo`
  ADD PRIMARY KEY (`taxid`),
  ADD KEY `shippingtaxinfo_taxname_idx` (`taxname`);

--
-- Indexes for table `vtiger_shorturls`
--
ALTER TABLE `vtiger_shorturls`
  ADD PRIMARY KEY (`id`),
  ADD KEY `uid` (`uid`);

--
-- Indexes for table `vtiger_smsnotifier`
--
ALTER TABLE `vtiger_smsnotifier`
  ADD PRIMARY KEY (`smsnotifierid`);

--
-- Indexes for table `vtiger_smsnotifiercf`
--
ALTER TABLE `vtiger_smsnotifiercf`
  ADD PRIMARY KEY (`smsnotifierid`);

--
-- Indexes for table `vtiger_smsnotifier_status`
--
ALTER TABLE `vtiger_smsnotifier_status`
  ADD PRIMARY KEY (`statusid`);

--
-- Indexes for table `vtiger_sms_reminder`
--
ALTER TABLE `vtiger_sms_reminder`
  ADD PRIMARY KEY (`sms_reminderid`);

--
-- Indexes for table `vtiger_sms_remind_invitees`
--
ALTER TABLE `vtiger_sms_remind_invitees`
  ADD PRIMARY KEY (`sms_remind_inviteesid`);

--
-- Indexes for table `vtiger_sms_remind_user`
--
ALTER TABLE `vtiger_sms_remind_user`
  ADD PRIMARY KEY (`sms_remind_userid`);

--
-- Indexes for table `vtiger_sobillads`
--
ALTER TABLE `vtiger_sobillads`
  ADD PRIMARY KEY (`sobilladdressid`);

--
-- Indexes for table `vtiger_soshipads`
--
ALTER TABLE `vtiger_soshipads`
  ADD PRIMARY KEY (`soshipaddressid`);

--
-- Indexes for table `vtiger_sostatus`
--
ALTER TABLE `vtiger_sostatus`
  ADD PRIMARY KEY (`sostatusid`),
  ADD UNIQUE KEY `sostatus_sostatus_idx` (`sostatus`);

--
-- Indexes for table `vtiger_sostatushistory`
--
ALTER TABLE `vtiger_sostatushistory`
  ADD PRIMARY KEY (`historyid`),
  ADD KEY `sostatushistory_salesorderid_idx` (`salesorderid`);

--
-- Indexes for table `vtiger_start_hour`
--
ALTER TABLE `vtiger_start_hour`
  ADD PRIMARY KEY (`start_hourid`);

--
-- Indexes for table `vtiger_status`
--
ALTER TABLE `vtiger_status`
  ADD PRIMARY KEY (`statusid`);

--
-- Indexes for table `vtiger_tab`
--
ALTER TABLE `vtiger_tab`
  ADD PRIMARY KEY (`tabid`),
  ADD UNIQUE KEY `tab_name_idx` (`name`),
  ADD KEY `tab_modifiedby_idx` (`modifiedby`),
  ADD KEY `tab_tabid_idx` (`tabid`);

--
-- Indexes for table `vtiger_tab_info`
--
ALTER TABLE `vtiger_tab_info`
  ADD KEY `fk_1_vtiger_tab_info` (`tabid`);

--
-- Indexes for table `vtiger_taskpriority`
--
ALTER TABLE `vtiger_taskpriority`
  ADD PRIMARY KEY (`taskpriorityid`);

--
-- Indexes for table `vtiger_taskstatus`
--
ALTER TABLE `vtiger_taskstatus`
  ADD PRIMARY KEY (`taskstatusid`);

--
-- Indexes for table `vtiger_taxclass`
--
ALTER TABLE `vtiger_taxclass`
  ADD PRIMARY KEY (`taxclassid`),
  ADD UNIQUE KEY `taxclass_carrier_idx` (`taxclass`);

--
-- Indexes for table `vtiger_taxregions`
--
ALTER TABLE `vtiger_taxregions`
  ADD PRIMARY KEY (`regionid`);

--
-- Indexes for table `vtiger_ticketcategories`
--
ALTER TABLE `vtiger_ticketcategories`
  ADD PRIMARY KEY (`ticketcategories_id`);

--
-- Indexes for table `vtiger_ticketcf`
--
ALTER TABLE `vtiger_ticketcf`
  ADD PRIMARY KEY (`ticketid`);

--
-- Indexes for table `vtiger_ticketcomments`
--
ALTER TABLE `vtiger_ticketcomments`
  ADD PRIMARY KEY (`commentid`),
  ADD KEY `ticketcomments_ticketid_idx` (`ticketid`);

--
-- Indexes for table `vtiger_ticketpriorities`
--
ALTER TABLE `vtiger_ticketpriorities`
  ADD PRIMARY KEY (`ticketpriorities_id`);

--
-- Indexes for table `vtiger_ticketseverities`
--
ALTER TABLE `vtiger_ticketseverities`
  ADD PRIMARY KEY (`ticketseverities_id`);

--
-- Indexes for table `vtiger_ticketstatus`
--
ALTER TABLE `vtiger_ticketstatus`
  ADD PRIMARY KEY (`ticketstatus_id`);

--
-- Indexes for table `vtiger_time_zone`
--
ALTER TABLE `vtiger_time_zone`
  ADD PRIMARY KEY (`time_zoneid`);

--
-- Indexes for table `vtiger_tmp_read_group_rel_sharing_per`
--
ALTER TABLE `vtiger_tmp_read_group_rel_sharing_per`
  ADD PRIMARY KEY (`userid`,`tabid`,`relatedtabid`,`sharedgroupid`),
  ADD KEY `tmp_read_group_rel_sharing_per_userid_sharedgroupid_tabid` (`userid`,`sharedgroupid`,`tabid`);

--
-- Indexes for table `vtiger_tmp_read_group_sharing_per`
--
ALTER TABLE `vtiger_tmp_read_group_sharing_per`
  ADD PRIMARY KEY (`userid`,`tabid`,`sharedgroupid`),
  ADD KEY `tmp_read_group_sharing_per_userid_sharedgroupid_idx` (`userid`,`sharedgroupid`);

--
-- Indexes for table `vtiger_tmp_read_user_rel_sharing_per`
--
ALTER TABLE `vtiger_tmp_read_user_rel_sharing_per`
  ADD PRIMARY KEY (`userid`,`tabid`,`relatedtabid`,`shareduserid`),
  ADD KEY `tmp_read_user_rel_sharing_per_userid_shared_reltabid_idx` (`userid`,`shareduserid`,`relatedtabid`);

--
-- Indexes for table `vtiger_tmp_read_user_sharing_per`
--
ALTER TABLE `vtiger_tmp_read_user_sharing_per`
  ADD PRIMARY KEY (`userid`,`tabid`,`shareduserid`),
  ADD KEY `tmp_read_user_sharing_per_userid_shareduserid_idx` (`userid`,`shareduserid`);

--
-- Indexes for table `vtiger_tmp_write_group_rel_sharing_per`
--
ALTER TABLE `vtiger_tmp_write_group_rel_sharing_per`
  ADD PRIMARY KEY (`userid`,`tabid`,`relatedtabid`,`sharedgroupid`),
  ADD KEY `tmp_write_group_rel_sharing_per_userid_sharedgroupid_tabid_idx` (`userid`,`sharedgroupid`,`tabid`);

--
-- Indexes for table `vtiger_tmp_write_group_sharing_per`
--
ALTER TABLE `vtiger_tmp_write_group_sharing_per`
  ADD PRIMARY KEY (`userid`,`tabid`,`sharedgroupid`),
  ADD KEY `tmp_write_group_sharing_per_UK1` (`userid`,`sharedgroupid`);

--
-- Indexes for table `vtiger_tmp_write_user_rel_sharing_per`
--
ALTER TABLE `vtiger_tmp_write_user_rel_sharing_per`
  ADD PRIMARY KEY (`userid`,`tabid`,`relatedtabid`,`shareduserid`),
  ADD KEY `tmp_write_user_rel_sharing_per_userid_sharduserid_tabid_idx` (`userid`,`shareduserid`,`tabid`);

--
-- Indexes for table `vtiger_tmp_write_user_sharing_per`
--
ALTER TABLE `vtiger_tmp_write_user_sharing_per`
  ADD PRIMARY KEY (`userid`,`tabid`,`shareduserid`),
  ADD KEY `tmp_write_user_sharing_per_userid_shareduserid_idx` (`userid`,`shareduserid`);

--
-- Indexes for table `vtiger_tracker`
--
ALTER TABLE `vtiger_tracker`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_tracking_unit`
--
ALTER TABLE `vtiger_tracking_unit`
  ADD PRIMARY KEY (`tracking_unitid`);

--
-- Indexes for table `vtiger_troubletickets`
--
ALTER TABLE `vtiger_troubletickets`
  ADD PRIMARY KEY (`ticketid`),
  ADD KEY `troubletickets_ticketid_idx` (`ticketid`),
  ADD KEY `troubletickets_status_idx` (`status`),
  ADD KEY `idx_troubletickets_account` (`parent_id`),
  ADD KEY `idx_ticket_contact` (`contact_id`),
  ADD KEY `idx_sarv_ticket_parent_status` (`parent_id`,`status`),
  ADD KEY `idx_sarv_ticket_contact` (`contact_id`);

--
-- Indexes for table `vtiger_usageunit`
--
ALTER TABLE `vtiger_usageunit`
  ADD PRIMARY KEY (`usageunitid`),
  ADD UNIQUE KEY `usageunit_usageunit_idx` (`usageunit`);

--
-- Indexes for table `vtiger_user2mergefields`
--
ALTER TABLE `vtiger_user2mergefields`
  ADD KEY `userid_tabid_idx` (`userid`,`tabid`);

--
-- Indexes for table `vtiger_user2role`
--
ALTER TABLE `vtiger_user2role`
  ADD PRIMARY KEY (`userid`),
  ADD KEY `user2role_roleid_idx` (`roleid`);

--
-- Indexes for table `vtiger_users2group`
--
ALTER TABLE `vtiger_users2group`
  ADD PRIMARY KEY (`groupid`,`userid`),
  ADD KEY `users2group_groupname_uerid_idx` (`groupid`,`userid`),
  ADD KEY `fk_2_vtiger_users2group` (`userid`);

--
-- Indexes for table `vtiger_users_last_import`
--
ALTER TABLE `vtiger_users_last_import`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user_id` (`assigned_user_id`);

--
-- Indexes for table `vtiger_user_module_preferences`
--
ALTER TABLE `vtiger_user_module_preferences`
  ADD PRIMARY KEY (`userid`,`tabid`),
  ADD KEY `fk_2_vtiger_user_module_preferences` (`tabid`);

--
-- Indexes for table `vtiger_vendor`
--
ALTER TABLE `vtiger_vendor`
  ADD PRIMARY KEY (`vendorid`);

--
-- Indexes for table `vtiger_vendorcf`
--
ALTER TABLE `vtiger_vendorcf`
  ADD PRIMARY KEY (`vendorid`);

--
-- Indexes for table `vtiger_vendorcontactrel`
--
ALTER TABLE `vtiger_vendorcontactrel`
  ADD PRIMARY KEY (`vendorid`,`contactid`),
  ADD KEY `vendorcontactrel_vendorid_idx` (`vendorid`),
  ADD KEY `vendorcontactrel_contact_idx` (`contactid`);

--
-- Indexes for table `vtiger_version`
--
ALTER TABLE `vtiger_version`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_visibility`
--
ALTER TABLE `vtiger_visibility`
  ADD PRIMARY KEY (`visibilityid`),
  ADD UNIQUE KEY `visibility_visibility_idx` (`visibility`);

--
-- Indexes for table `vtiger_webforms`
--
ALTER TABLE `vtiger_webforms`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `webformname` (`name`),
  ADD UNIQUE KEY `publicid` (`id`),
  ADD KEY `webforms_webforms_id_idx` (`id`);

--
-- Indexes for table `vtiger_webforms_field`
--
ALTER TABLE `vtiger_webforms_field`
  ADD PRIMARY KEY (`id`),
  ADD KEY `webforms_webforms_field_idx` (`id`),
  ADD KEY `fk_1_vtiger_webforms_field` (`webformid`),
  ADD KEY `fk_2_vtiger_webforms_field` (`fieldname`),
  ADD KEY `fk_4_vtiger_webforms_field` (`fieldid`);

--
-- Indexes for table `vtiger_webform_file_fields`
--
ALTER TABLE `vtiger_webform_file_fields`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_vtiger_webforms` (`webformid`);

--
-- Indexes for table `vtiger_wordtemplates`
--
ALTER TABLE `vtiger_wordtemplates`
  ADD PRIMARY KEY (`templateid`);

--
-- Indexes for table `vtiger_wsapp_logs_basic`
--
ALTER TABLE `vtiger_wsapp_logs_basic`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_wsapp_logs_details`
--
ALTER TABLE `vtiger_wsapp_logs_details`
  ADD KEY `vtiger_wsapp_logs_basic_ibfk_1` (`id`);

--
-- Indexes for table `vtiger_wsapp_recordmapping`
--
ALTER TABLE `vtiger_wsapp_recordmapping`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_wsapp_sync_state`
--
ALTER TABLE `vtiger_wsapp_sync_state`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_ws_entity`
--
ALTER TABLE `vtiger_ws_entity`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_ws_entity_fieldtype`
--
ALTER TABLE `vtiger_ws_entity_fieldtype`
  ADD PRIMARY KEY (`fieldtypeid`),
  ADD UNIQUE KEY `vtiger_idx_1_tablename_fieldname` (`table_name`,`field_name`);

--
-- Indexes for table `vtiger_ws_entity_name`
--
ALTER TABLE `vtiger_ws_entity_name`
  ADD PRIMARY KEY (`entity_id`);

--
-- Indexes for table `vtiger_ws_entity_referencetype`
--
ALTER TABLE `vtiger_ws_entity_referencetype`
  ADD PRIMARY KEY (`fieldtypeid`,`type`);

--
-- Indexes for table `vtiger_ws_entity_tables`
--
ALTER TABLE `vtiger_ws_entity_tables`
  ADD PRIMARY KEY (`webservice_entity_id`,`table_name`);

--
-- Indexes for table `vtiger_ws_fieldinfo`
--
ALTER TABLE `vtiger_ws_fieldinfo`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `vtiger_ws_fieldtype`
--
ALTER TABLE `vtiger_ws_fieldtype`
  ADD PRIMARY KEY (`fieldtypeid`),
  ADD UNIQUE KEY `uitype_idx` (`uitype`);

--
-- Indexes for table `vtiger_ws_operation`
--
ALTER TABLE `vtiger_ws_operation`
  ADD PRIMARY KEY (`operationid`);

--
-- Indexes for table `vtiger_ws_operation_parameters`
--
ALTER TABLE `vtiger_ws_operation_parameters`
  ADD PRIMARY KEY (`operationid`,`name`);

--
-- Indexes for table `vtiger_ws_referencetype`
--
ALTER TABLE `vtiger_ws_referencetype`
  ADD PRIMARY KEY (`fieldtypeid`,`type`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `com_vtiger_workflows`
--
ALTER TABLE `com_vtiger_workflows`
  MODIFY `workflow_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;

--
-- AUTO_INCREMENT for table `com_vtiger_workflowtasks`
--
ALTER TABLE `com_vtiger_workflowtasks`
  MODIFY `task_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;

--
-- AUTO_INCREMENT for table `com_vtiger_workflowtemplates`
--
ALTER TABLE `com_vtiger_workflowtemplates`
  MODIFY `template_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `gooyaacc_cloud_files`
--
ALTER TABLE `gooyaacc_cloud_files`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=144;

--
-- AUTO_INCREMENT for table `gooyaacc_cloud_folders`
--
ALTER TABLE `gooyaacc_cloud_folders`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=285;

--
-- AUTO_INCREMENT for table `gooyaacc_cloud_log`
--
ALTER TABLE `gooyaacc_cloud_log`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1213;

--
-- AUTO_INCREMENT for table `gooyaacc_cloud_shares`
--
ALTER TABLE `gooyaacc_cloud_shares`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=109;

--
-- AUTO_INCREMENT for table `gooyaacc_cloud_versions`
--
ALTER TABLE `gooyaacc_cloud_versions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41;

--
-- AUTO_INCREMENT for table `gooyaacc_competitors`
--
ALTER TABLE `gooyaacc_competitors`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `gooyaacc_kpi_audit_logs`
--
ALTER TABLE `gooyaacc_kpi_audit_logs`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `gooyaacc_kpi_ceo_priorities`
--
ALTER TABLE `gooyaacc_kpi_ceo_priorities`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `gooyaacc_kpi_definitions`
--
ALTER TABLE `gooyaacc_kpi_definitions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=71;

--
-- AUTO_INCREMENT for table `gooyaacc_kpi_evaluations_main`
--
ALTER TABLE `gooyaacc_kpi_evaluations_main`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=188;

--
-- AUTO_INCREMENT for table `gooyaacc_kpi_evaluation_scores`
--
ALTER TABLE `gooyaacc_kpi_evaluation_scores`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3431;

--
-- AUTO_INCREMENT for table `gooyaacc_kpi_evaluator_weights`
--
ALTER TABLE `gooyaacc_kpi_evaluator_weights`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `gooyaacc_kpi_factor_weights`
--
ALTER TABLE `gooyaacc_kpi_factor_weights`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `gooyaacc_kpi_license`
--
ALTER TABLE `gooyaacc_kpi_license`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `gooyaacc_kpi_license_logs`
--
ALTER TABLE `gooyaacc_kpi_license_logs`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `gooyaacc_kpi_saved_filters`
--
ALTER TABLE `gooyaacc_kpi_saved_filters`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `gooyaacc_kpi_supervisor_notes`
--
ALTER TABLE `gooyaacc_kpi_supervisor_notes`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `gooyaacc_kpi_target_evaluators`
--
ALTER TABLE `gooyaacc_kpi_target_evaluators`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `gooyaacc_kpi_teams`
--
ALTER TABLE `gooyaacc_kpi_teams`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;

--
-- AUTO_INCREMENT for table `gooyaacc_kpi_team_members`
--
ALTER TABLE `gooyaacc_kpi_team_members`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=84;

--
-- AUTO_INCREMENT for table `gooyaacc_notes`
--
ALTER TABLE `gooyaacc_notes`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `gooyaacc_note_attachments`
--
ALTER TABLE `gooyaacc_note_attachments`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `gooyaacc_pay`
--
ALTER TABLE `gooyaacc_pay`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `gooyaacc_payments`
--
ALTER TABLE `gooyaacc_payments`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `gooyaacc_pay_alloc`
--
ALTER TABLE `gooyaacc_pay_alloc`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `gooyaacc_pdf_templates`
--
ALTER TABLE `gooyaacc_pdf_templates`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `gooya_account_email`
--
ALTER TABLE `gooya_account_email`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `gooya_account_phone`
--
ALTER TABLE `gooya_account_phone`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37;

--
-- AUTO_INCREMENT for table `gooya_account_timeline`
--
ALTER TABLE `gooya_account_timeline`
  MODIFY `timeline_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=418;

--
-- AUTO_INCREMENT for table `gooya_contact_account_rel`
--
ALTER TABLE `gooya_contact_account_rel`
  MODIFY `relation_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=98;

--
-- AUTO_INCREMENT for table `gooya_contact_email`
--
ALTER TABLE `gooya_contact_email`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;

--
-- AUTO_INCREMENT for table `gooya_contact_phone`
--
ALTER TABLE `gooya_contact_phone`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=42;

--
-- AUTO_INCREMENT for table `gooya_lead_email`
--
ALTER TABLE `gooya_lead_email`
  MODIFY `id` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=153;

--
-- AUTO_INCREMENT for table `gooya_lead_phone`
--
ALTER TABLE `gooya_lead_phone`
  MODIFY `id` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=196;

--
-- AUTO_INCREMENT for table `gouya_topbar_favorites`
--
ALTER TABLE `gouya_topbar_favorites`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `goya_dashboard_widgets`
--
ALTER TABLE `goya_dashboard_widgets`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `goya_onboarding`
--
ALTER TABLE `goya_onboarding`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `sarv_field_acl_audit`
--
ALTER TABLE `sarv_field_acl_audit`
  MODIFY `audit_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `sarv_field_acl_rules`
--
ALTER TABLE `sarv_field_acl_rules`
  MODIFY `rule_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `sarv_geographic_regions`
--
ALTER TABLE `sarv_geographic_regions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=190;

--
-- AUTO_INCREMENT for table `sarv_module_visibility_audit`
--
ALTER TABLE `sarv_module_visibility_audit`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `sarv_password_policy_audit`
--
ALTER TABLE `sarv_password_policy_audit`
  MODIFY `audit_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `sarv_payment_allocation_history`
--
ALTER TABLE `sarv_payment_allocation_history`
  MODIFY `historyid` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;

--
-- AUTO_INCREMENT for table `sarv_role_audit`
--
ALTER TABLE `sarv_role_audit`
  MODIFY `audit_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=76;

--
-- AUTO_INCREMENT for table `sarv_security_group_audit`
--
ALTER TABLE `sarv_security_group_audit`
  MODIFY `audit_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;

--
-- AUTO_INCREMENT for table `sarv_stock_movement_ledger`
--
ALTER TABLE `sarv_stock_movement_ledger`
  MODIFY `movement_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `sarv_subpanel_visibility_audit`
--
ALTER TABLE `sarv_subpanel_visibility_audit`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `sarv_team_audit`
--
ALTER TABLE `sarv_team_audit`
  MODIFY `audit_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT for table `sarv_user_emails`
--
ALTER TABLE `sarv_user_emails`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=54;

--
-- AUTO_INCREMENT for table `sarv_user_phones`
--
ALTER TABLE `sarv_user_phones`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=53;

--
-- AUTO_INCREMENT for table `sarv_user_profile_audit`
--
ALTER TABLE `sarv_user_profile_audit`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT for table `vtiger_access_level`
--
ALTER TABLE `vtiger_access_level`
  MODIFY `access_levelid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_accountrating`
--
ALTER TABLE `vtiger_accountrating`
  MODIFY `accountratingid` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_accounttype`
--
ALTER TABLE `vtiger_accounttype`
  MODIFY `accounttypeid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `vtiger_account_status`
--
ALTER TABLE `vtiger_account_status`
  MODIFY `account_statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_account_type`
--
ALTER TABLE `vtiger_account_type`
  MODIFY `account_typeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_activitytype`
--
ALTER TABLE `vtiger_activitytype`
  MODIFY `activitytypeid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_activity_reminder_popup`
--
ALTER TABLE `vtiger_activity_reminder_popup`
  MODIFY `reminderid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;

--
-- AUTO_INCREMENT for table `vtiger_activity_view`
--
ALTER TABLE `vtiger_activity_view`
  MODIFY `activity_viewid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_assetstatus`
--
ALTER TABLE `vtiger_assetstatus`
  MODIFY `assetstatusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_attachmentsfolder`
--
ALTER TABLE `vtiger_attachmentsfolder`
  MODIFY `folderid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `vtiger_calendarsharedtype`
--
ALTER TABLE `vtiger_calendarsharedtype`
  MODIFY `calendarsharedtypeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_callduration`
--
ALTER TABLE `vtiger_callduration`
  MODIFY `calldurationid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_call_direction`
--
ALTER TABLE `vtiger_call_direction`
  MODIFY `call_directionid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_campaignstatus`
--
ALTER TABLE `vtiger_campaignstatus`
  MODIFY `campaignstatusid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `vtiger_campaigntype`
--
ALTER TABLE `vtiger_campaigntype`
  MODIFY `campaigntypeid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `vtiger_carrier`
--
ALTER TABLE `vtiger_carrier`
  MODIFY `carrierid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_cf_credit_source`
--
ALTER TABLE `vtiger_cf_credit_source`
  MODIFY `cf_credit_sourceid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_cf_credit_status`
--
ALTER TABLE `vtiger_cf_credit_status`
  MODIFY `cf_credit_statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_cf_credit_type`
--
ALTER TABLE `vtiger_cf_credit_type`
  MODIFY `cf_credit_typeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_cf_forecast_category`
--
ALTER TABLE `vtiger_cf_forecast_category`
  MODIFY `cf_forecast_categoryid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_cf_grouping1`
--
ALTER TABLE `vtiger_cf_grouping1`
  MODIFY `cf_grouping1id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_cf_grouping2`
--
ALTER TABLE `vtiger_cf_grouping2`
  MODIFY `cf_grouping2id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_cf_invoice_cycles`
--
ALTER TABLE `vtiger_cf_invoice_cycles`
  MODIFY `cf_invoice_cyclesid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_cf_invoice_kind`
--
ALTER TABLE `vtiger_cf_invoice_kind`
  MODIFY `cf_invoice_kindid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_cf_lead_party_type`
--
ALTER TABLE `vtiger_cf_lead_party_type`
  MODIFY `cf_lead_party_typeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_cf_loss_reason`
--
ALTER TABLE `vtiger_cf_loss_reason`
  MODIFY `cf_loss_reasonid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_cf_opportunity_currency`
--
ALTER TABLE `vtiger_cf_opportunity_currency`
  MODIFY `cf_opportunity_currencyid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `vtiger_cf_opportunity_priority`
--
ALTER TABLE `vtiger_cf_opportunity_priority`
  MODIFY `cf_opportunity_priorityid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_cf_party_type`
--
ALTER TABLE `vtiger_cf_party_type`
  MODIFY `cf_party_typeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_cf_sales_process`
--
ALTER TABLE `vtiger_cf_sales_process`
  MODIFY `cf_sales_processid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `vtiger_channel`
--
ALTER TABLE `vtiger_channel`
  MODIFY `channelid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `vtiger_communications_audit`
--
ALTER TABLE `vtiger_communications_audit`
  MODIFY `auditid` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `vtiger_contract_priority`
--
ALTER TABLE `vtiger_contract_priority`
  MODIFY `contract_priorityid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_contract_status`
--
ALTER TABLE `vtiger_contract_status`
  MODIFY `contract_statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `vtiger_contract_type`
--
ALTER TABLE `vtiger_contract_type`
  MODIFY `contract_typeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `vtiger_convertleadmapping`
--
ALTER TABLE `vtiger_convertleadmapping`
  MODIFY `cfmid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=57;

--
-- AUTO_INCREMENT for table `vtiger_convertpotentialmapping`
--
ALTER TABLE `vtiger_convertpotentialmapping`
  MODIFY `cfmid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_cron_task`
--
ALTER TABLE `vtiger_cron_task`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `vtiger_currencies`
--
ALTER TABLE `vtiger_currencies`
  MODIFY `currencyid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=139;

--
-- AUTO_INCREMENT for table `vtiger_currency`
--
ALTER TABLE `vtiger_currency`
  MODIFY `currencyid` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_currency_decimal_separator`
--
ALTER TABLE `vtiger_currency_decimal_separator`
  MODIFY `currency_decimal_separatorid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_currency_grouping_pattern`
--
ALTER TABLE `vtiger_currency_grouping_pattern`
  MODIFY `currency_grouping_patternid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_currency_grouping_separator`
--
ALTER TABLE `vtiger_currency_grouping_separator`
  MODIFY `currency_grouping_separatorid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_currency_info`
--
ALTER TABLE `vtiger_currency_info`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_currency_symbol_placement`
--
ALTER TABLE `vtiger_currency_symbol_placement`
  MODIFY `currency_symbol_placementid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_dashboard_tabs`
--
ALTER TABLE `vtiger_dashboard_tabs`
  MODIFY `id` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;

--
-- AUTO_INCREMENT for table `vtiger_date_format`
--
ALTER TABLE `vtiger_date_format`
  MODIFY `date_formatid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_dayoftheweek`
--
ALTER TABLE `vtiger_dayoftheweek`
  MODIFY `dayoftheweekid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `vtiger_defaultactivitytype`
--
ALTER TABLE `vtiger_defaultactivitytype`
  MODIFY `defaultactivitytypeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_defaultcalendarview`
--
ALTER TABLE `vtiger_defaultcalendarview`
  MODIFY `defaultcalendarviewid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_defaulteventstatus`
--
ALTER TABLE `vtiger_defaulteventstatus`
  MODIFY `defaulteventstatusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_defaultlandingpage`
--
ALTER TABLE `vtiger_defaultlandingpage`
  MODIFY `defaultlandingpageid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_default_record_view`
--
ALTER TABLE `vtiger_default_record_view`
  MODIFY `default_record_viewid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_def_org_share`
--
ALTER TABLE `vtiger_def_org_share`
  MODIFY `ruleid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;

--
-- AUTO_INCREMENT for table `vtiger_deposit_status`
--
ALTER TABLE `vtiger_deposit_status`
  MODIFY `deposit_statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_deposit_type`
--
ALTER TABLE `vtiger_deposit_type`
  MODIFY `deposit_typeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_durationhrs`
--
ALTER TABLE `vtiger_durationhrs`
  MODIFY `hrsid` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_durationmins`
--
ALTER TABLE `vtiger_durationmins`
  MODIFY `minsid` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_duration_minutes`
--
ALTER TABLE `vtiger_duration_minutes`
  MODIFY `minutesid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_emails_recipientprefs`
--
ALTER TABLE `vtiger_emails_recipientprefs`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_emailtemplates`
--
ALTER TABLE `vtiger_emailtemplates`
  MODIFY `templateid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

--
-- AUTO_INCREMENT for table `vtiger_eventhandlers`
--
ALTER TABLE `vtiger_eventhandlers`
  MODIFY `eventhandler_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45;

--
-- AUTO_INCREMENT for table `vtiger_eventhandler_module`
--
ALTER TABLE `vtiger_eventhandler_module`
  MODIFY `eventhandler_module_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `vtiger_eventstatus`
--
ALTER TABLE `vtiger_eventstatus`
  MODIFY `eventstatusid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_expectedresponse`
--
ALTER TABLE `vtiger_expectedresponse`
  MODIFY `expectedresponseid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_faq`
--
ALTER TABLE `vtiger_faq`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_faqcategories`
--
ALTER TABLE `vtiger_faqcategories`
  MODIFY `faqcategories_id` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `vtiger_faqcomments`
--
ALTER TABLE `vtiger_faqcomments`
  MODIFY `commentid` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_faqstatus`
--
ALTER TABLE `vtiger_faqstatus`
  MODIFY `faqstatus_id` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_field`
--
ALTER TABLE `vtiger_field`
  MODIFY `fieldid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1244;

--
-- AUTO_INCREMENT for table `vtiger_gift_status`
--
ALTER TABLE `vtiger_gift_status`
  MODIFY `gift_statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `vtiger_glacct`
--
ALTER TABLE `vtiger_glacct`
  MODIFY `glacctid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `vtiger_gooyagoals`
--
ALTER TABLE `vtiger_gooyagoals`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=49;

--
-- AUTO_INCREMENT for table `vtiger_grant_status`
--
ALTER TABLE `vtiger_grant_status`
  MODIFY `grant_statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_hour_format`
--
ALTER TABLE `vtiger_hour_format`
  MODIFY `hour_formatid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_import_maps`
--
ALTER TABLE `vtiger_import_maps`
  MODIFY `id` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_industry`
--
ALTER TABLE `vtiger_industry`
  MODIFY `industryid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38;

--
-- AUTO_INCREMENT for table `vtiger_inventorycharges`
--
ALTER TABLE `vtiger_inventorycharges`
  MODIFY `chargeid` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `vtiger_inventorynotification`
--
ALTER TABLE `vtiger_inventorynotification`
  MODIFY `notificationid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_inventoryproductrel`
--
ALTER TABLE `vtiger_inventoryproductrel`
  MODIFY `lineitem_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=168;

--
-- AUTO_INCREMENT for table `vtiger_invoicestatus`
--
ALTER TABLE `vtiger_invoicestatus`
  MODIFY `invoicestatusid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `vtiger_invoicestatushistory`
--
ALTER TABLE `vtiger_invoicestatushistory`
  MODIFY `historyid` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_language`
--
ALTER TABLE `vtiger_language`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT for table `vtiger_leadsource`
--
ALTER TABLE `vtiger_leadsource`
  MODIFY `leadsourceid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `vtiger_leadstage`
--
ALTER TABLE `vtiger_leadstage`
  MODIFY `leadstageid` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_leadstatus`
--
ALTER TABLE `vtiger_leadstatus`
  MODIFY `leadstatusid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

--
-- AUTO_INCREMENT for table `vtiger_lead_view`
--
ALTER TABLE `vtiger_lead_view`
  MODIFY `lead_viewid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_list_status`
--
ALTER TABLE `vtiger_list_status`
  MODIFY `list_statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_list_type`
--
ALTER TABLE `vtiger_list_type`
  MODIFY `list_typeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_location_status`
--
ALTER TABLE `vtiger_location_status`
  MODIFY `location_statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_location_type`
--
ALTER TABLE `vtiger_location_type`
  MODIFY `location_typeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_loginhistory`
--
ALTER TABLE `vtiger_loginhistory`
  MODIFY `login_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=88;

--
-- AUTO_INCREMENT for table `vtiger_mailscanner_actions`
--
ALTER TABLE `vtiger_mailscanner_actions`
  MODIFY `actionid` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_mailscanner_folders`
--
ALTER TABLE `vtiger_mailscanner_folders`
  MODIFY `folderid` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_mailscanner_rules`
--
ALTER TABLE `vtiger_mailscanner_rules`
  MODIFY `ruleid` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_manufacturer`
--
ALTER TABLE `vtiger_manufacturer`
  MODIFY `manufacturerid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_mobile_alerts`
--
ALTER TABLE `vtiger_mobile_alerts`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `vtiger_module_dashboard_widgets`
--
ALTER TABLE `vtiger_module_dashboard_widgets`
  MODIFY `id` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_notificationscheduler`
--
ALTER TABLE `vtiger_notificationscheduler`
  MODIFY `schedulednotificationid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `vtiger_no_of_currency_decimals`
--
ALTER TABLE `vtiger_no_of_currency_decimals`
  MODIFY `no_of_currency_decimalsid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `vtiger_opportunitystage`
--
ALTER TABLE `vtiger_opportunitystage`
  MODIFY `potstageid` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_opportunity_type`
--
ALTER TABLE `vtiger_opportunity_type`
  MODIFY `opptypeid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_othereventduration`
--
ALTER TABLE `vtiger_othereventduration`
  MODIFY `othereventdurationid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_participation_status`
--
ALTER TABLE `vtiger_participation_status`
  MODIFY `participation_statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_participation_type`
--
ALTER TABLE `vtiger_participation_type`
  MODIFY `participation_typeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_payment_direction`
--
ALTER TABLE `vtiger_payment_direction`
  MODIFY `payment_directionid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_payment_method`
--
ALTER TABLE `vtiger_payment_method`
  MODIFY `payment_methodid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `vtiger_payment_status`
--
ALTER TABLE `vtiger_payment_status`
  MODIFY `payment_statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_payment_type`
--
ALTER TABLE `vtiger_payment_type`
  MODIFY `payment_typeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_pbxmanager`
--
ALTER TABLE `vtiger_pbxmanager`
  MODIFY `pbxmanagerid` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;

--
-- AUTO_INCREMENT for table `vtiger_pbxmanager_gateway`
--
ALTER TABLE `vtiger_pbxmanager_gateway`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_picklist`
--
ALTER TABLE `vtiger_picklist`
  MODIFY `picklistid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=94;

--
-- AUTO_INCREMENT for table `vtiger_postatus`
--
ALTER TABLE `vtiger_postatus`
  MODIFY `postatusid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_postatushistory`
--
ALTER TABLE `vtiger_postatushistory`
  MODIFY `historyid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=53;

--
-- AUTO_INCREMENT for table `vtiger_potstagehistory`
--
ALTER TABLE `vtiger_potstagehistory`
  MODIFY `historyid` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_priority`
--
ALTER TABLE `vtiger_priority`
  MODIFY `priorityid` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_productcategory`
--
ALTER TABLE `vtiger_productcategory`
  MODIFY `productcategoryid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `vtiger_profile`
--
ALTER TABLE `vtiger_profile`
  MODIFY `profileid` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=42;

--
-- AUTO_INCREMENT for table `vtiger_progress`
--
ALTER TABLE `vtiger_progress`
  MODIFY `progressid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `vtiger_projectmilestonetype`
--
ALTER TABLE `vtiger_projectmilestonetype`
  MODIFY `projectmilestonetypeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_projectpriority`
--
ALTER TABLE `vtiger_projectpriority`
  MODIFY `projectpriorityid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_projectstatus`
--
ALTER TABLE `vtiger_projectstatus`
  MODIFY `projectstatusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `vtiger_projecttaskpriority`
--
ALTER TABLE `vtiger_projecttaskpriority`
  MODIFY `projecttaskpriorityid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_projecttaskprogress`
--
ALTER TABLE `vtiger_projecttaskprogress`
  MODIFY `projecttaskprogressid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `vtiger_projecttaskstatus`
--
ALTER TABLE `vtiger_projecttaskstatus`
  MODIFY `projecttaskstatusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `vtiger_projecttasktype`
--
ALTER TABLE `vtiger_projecttasktype`
  MODIFY `projecttasktypeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_projecttype`
--
ALTER TABLE `vtiger_projecttype`
  MODIFY `projecttypeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_quotestage`
--
ALTER TABLE `vtiger_quotestage`
  MODIFY `quotestageid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `vtiger_quotestagehistory`
--
ALTER TABLE `vtiger_quotestagehistory`
  MODIFY `historyid` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_rating`
--
ALTER TABLE `vtiger_rating`
  MODIFY `rating_id` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `vtiger_recurringevents`
--
ALTER TABLE `vtiger_recurringevents`
  MODIFY `recurringid` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_recurringtype`
--
ALTER TABLE `vtiger_recurringtype`
  MODIFY `recurringeventid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_reminder_interval`
--
ALTER TABLE `vtiger_reminder_interval`
  MODIFY `reminder_intervalid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `vtiger_reportfolder`
--
ALTER TABLE `vtiger_reportfolder`
  MODIFY `folderid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `vtiger_reservation_status`
--
ALTER TABLE `vtiger_reservation_status`
  MODIFY `reservation_statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `vtiger_response_status`
--
ALTER TABLE `vtiger_response_status`
  MODIFY `response_statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_rollupcomments_settings`
--
ALTER TABLE `vtiger_rollupcomments_settings`
  MODIFY `rollupid` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_rowheight`
--
ALTER TABLE `vtiger_rowheight`
  MODIFY `rowheightid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_sales_channel`
--
ALTER TABLE `vtiger_sales_channel`
  MODIFY `sales_channelid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_sales_stage`
--
ALTER TABLE `vtiger_sales_stage`
  MODIFY `sales_stage_id` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `vtiger_salutationtype`
--
ALTER TABLE `vtiger_salutationtype`
  MODIFY `salutationid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `vtiger_sample_status`
--
ALTER TABLE `vtiger_sample_status`
  MODIFY `sample_statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `vtiger_sarv_delivery_format`
--
ALTER TABLE `vtiger_sarv_delivery_format`
  MODIFY `sarv_delivery_formatid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_sarv_otp`
--
ALTER TABLE `vtiger_sarv_otp`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=82;

--
-- AUTO_INCREMENT for table `vtiger_sarv_payment_method`
--
ALTER TABLE `vtiger_sarv_payment_method`
  MODIFY `sarv_payment_methodid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_sarv_payment_status`
--
ALTER TABLE `vtiger_sarv_payment_status`
  MODIFY `sarv_payment_statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_sarv_po_category`
--
ALTER TABLE `vtiger_sarv_po_category`
  MODIFY `sarv_po_categoryid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `vtiger_sarv_print_template`
--
ALTER TABLE `vtiger_sarv_print_template`
  MODIFY `sarv_print_templateid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_sarv_shipping_method`
--
ALTER TABLE `vtiger_sarv_shipping_method`
  MODIFY `sarv_shipping_methodid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_sarv_sms_reminder`
--
ALTER TABLE `vtiger_sarv_sms_reminder`
  MODIFY `sarv_sms_reminderid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_servicecategory`
--
ALTER TABLE `vtiger_servicecategory`
  MODIFY `servicecategoryid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `vtiger_service_usageunit`
--
ALTER TABLE `vtiger_service_usageunit`
  MODIFY `service_usageunitid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_shorturls`
--
ALTER TABLE `vtiger_shorturls`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_smsnotifier_status`
--
ALTER TABLE `vtiger_smsnotifier_status`
  MODIFY `statusid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `vtiger_sms_reminder`
--
ALTER TABLE `vtiger_sms_reminder`
  MODIFY `sms_reminderid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_sms_remind_invitees`
--
ALTER TABLE `vtiger_sms_remind_invitees`
  MODIFY `sms_remind_inviteesid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `vtiger_sms_remind_user`
--
ALTER TABLE `vtiger_sms_remind_user`
  MODIFY `sms_remind_userid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `vtiger_sostatus`
--
ALTER TABLE `vtiger_sostatus`
  MODIFY `sostatusid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_sostatushistory`
--
ALTER TABLE `vtiger_sostatushistory`
  MODIFY `historyid` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_start_hour`
--
ALTER TABLE `vtiger_start_hour`
  MODIFY `start_hourid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;

--
-- AUTO_INCREMENT for table `vtiger_status`
--
ALTER TABLE `vtiger_status`
  MODIFY `statusid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_taskpriority`
--
ALTER TABLE `vtiger_taskpriority`
  MODIFY `taskpriorityid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_taskstatus`
--
ALTER TABLE `vtiger_taskstatus`
  MODIFY `taskstatusid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `vtiger_taxclass`
--
ALTER TABLE `vtiger_taxclass`
  MODIFY `taxclassid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_taxregions`
--
ALTER TABLE `vtiger_taxregions`
  MODIFY `regionid` int(10) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_ticketcategories`
--
ALTER TABLE `vtiger_ticketcategories`
  MODIFY `ticketcategories_id` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `vtiger_ticketcomments`
--
ALTER TABLE `vtiger_ticketcomments`
  MODIFY `commentid` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_ticketpriorities`
--
ALTER TABLE `vtiger_ticketpriorities`
  MODIFY `ticketpriorities_id` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_ticketseverities`
--
ALTER TABLE `vtiger_ticketseverities`
  MODIFY `ticketseverities_id` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_ticketstatus`
--
ALTER TABLE `vtiger_ticketstatus`
  MODIFY `ticketstatus_id` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_time_zone`
--
ALTER TABLE `vtiger_time_zone`
  MODIFY `time_zoneid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=98;

--
-- AUTO_INCREMENT for table `vtiger_tracker`
--
ALTER TABLE `vtiger_tracker`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT for table `vtiger_tracking_unit`
--
ALTER TABLE `vtiger_tracking_unit`
  MODIFY `tracking_unitid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `vtiger_usageunit`
--
ALTER TABLE `vtiger_usageunit`
  MODIFY `usageunitid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `vtiger_users_last_import`
--
ALTER TABLE `vtiger_users_last_import`
  MODIFY `id` int(36) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_version`
--
ALTER TABLE `vtiger_version`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `vtiger_visibility`
--
ALTER TABLE `vtiger_visibility`
  MODIFY `visibilityid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `vtiger_webforms`
--
ALTER TABLE `vtiger_webforms`
  MODIFY `id` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_webforms_field`
--
ALTER TABLE `vtiger_webforms_field`
  MODIFY `id` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_webform_file_fields`
--
ALTER TABLE `vtiger_webform_file_fields`
  MODIFY `id` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_wsapp_logs_basic`
--
ALTER TABLE `vtiger_wsapp_logs_basic`
  MODIFY `id` int(25) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_wsapp_recordmapping`
--
ALTER TABLE `vtiger_wsapp_recordmapping`
  MODIFY `id` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_wsapp_sync_state`
--
ALTER TABLE `vtiger_wsapp_sync_state`
  MODIFY `id` int(19) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vtiger_ws_entity`
--
ALTER TABLE `vtiger_ws_entity`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=49;

--
-- AUTO_INCREMENT for table `vtiger_ws_entity_fieldtype`
--
ALTER TABLE `vtiger_ws_entity_fieldtype`
  MODIFY `fieldtypeid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `vtiger_ws_fieldtype`
--
ALTER TABLE `vtiger_ws_fieldtype`
  MODIFY `fieldtypeid` int(19) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=43;

--
-- AUTO_INCREMENT for table `vtiger_ws_operation`
--
ALTER TABLE `vtiger_ws_operation`
  MODIFY `operationid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;

--
-- AUTO_INCREMENT for table `vtiger_ws_operation_parameters`
--
ALTER TABLE `vtiger_ws_operation_parameters`
  MODIFY `operationid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `gooyaacc_kpi_audit_logs`
--
ALTER TABLE `gooyaacc_kpi_audit_logs`
  ADD CONSTRAINT `fk_kpi_audit_user` FOREIGN KEY (`user_id`) REFERENCES `vtiger_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `gooyaacc_kpi_avatars`
--
ALTER TABLE `gooyaacc_kpi_avatars`
  ADD CONSTRAINT `fk_kpi_avatar_user` FOREIGN KEY (`user_id`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `gooyaacc_kpi_evaluations_main`
--
ALTER TABLE `gooyaacc_kpi_evaluations_main`
  ADD CONSTRAINT `fk_kpi_eval_evaluator` FOREIGN KEY (`evaluator_id`) REFERENCES `vtiger_users` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `gooyaacc_kpi_evaluator_weights`
--
ALTER TABLE `gooyaacc_kpi_evaluator_weights`
  ADD CONSTRAINT `fk_kpi_weight_evaluator_user` FOREIGN KEY (`evaluator_user_id`) REFERENCES `vtiger_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_kpi_weight_target_user` FOREIGN KEY (`target_user_id`) REFERENCES `vtiger_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `gooyaacc_kpi_permissions`
--
ALTER TABLE `gooyaacc_kpi_permissions`
  ADD CONSTRAINT `fk_kpi_permission_updater` FOREIGN KEY (`updated_by`) REFERENCES `vtiger_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_kpi_permission_user` FOREIGN KEY (`user_id`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `gooyaacc_kpi_saved_filters`
--
ALTER TABLE `gooyaacc_kpi_saved_filters`
  ADD CONSTRAINT `fk_kpi_filter_supervisor` FOREIGN KEY (`supervisor_id`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `gooyaacc_kpi_supervisor_notes`
--
ALTER TABLE `gooyaacc_kpi_supervisor_notes`
  ADD CONSTRAINT `fk_kpi_note_supervisor` FOREIGN KEY (`supervisor_id`) REFERENCES `vtiger_users` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_kpi_note_user` FOREIGN KEY (`user_id`) REFERENCES `vtiger_users` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `gooyaacc_kpi_teams`
--
ALTER TABLE `gooyaacc_kpi_teams`
  ADD CONSTRAINT `fk_kpi_team_supervisor` FOREIGN KEY (`supervisor_id`) REFERENCES `vtiger_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `gooyaacc_kpi_team_members`
--
ALTER TABLE `gooyaacc_kpi_team_members`
  ADD CONSTRAINT `fk_kpi_member_user` FOREIGN KEY (`user_id`) REFERENCES `vtiger_users` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `gooyaacc_kpi_user_profile`
--
ALTER TABLE `gooyaacc_kpi_user_profile`
  ADD CONSTRAINT `fk_kpi_profile_supervisor` FOREIGN KEY (`supervisor_id`) REFERENCES `vtiger_users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_kpi_profile_user` FOREIGN KEY (`user_id`) REFERENCES `vtiger_users` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `gooya_account_email`
--
ALTER TABLE `gooya_account_email`
  ADD CONSTRAINT `fk_gooya_account_email_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `gooya_account_phone`
--
ALTER TABLE `gooya_account_phone`
  ADD CONSTRAINT `fk_gooya_account_phone_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `gooya_account_timeline`
--
ALTER TABLE `gooya_account_timeline`
  ADD CONSTRAINT `fk_gooya_timeline_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `gooya_contact_account_rel`
--
ALTER TABLE `gooya_contact_account_rel`
  ADD CONSTRAINT `fk_gooya_contact_account_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_gooya_contact_account_contact` FOREIGN KEY (`contactid`) REFERENCES `vtiger_contactdetails` (`contactid`) ON DELETE CASCADE;

--
-- Constraints for table `gooya_lead_email`
--
ALTER TABLE `gooya_lead_email`
  ADD CONSTRAINT `fk_gooya_lead_email_lead` FOREIGN KEY (`leadid`) REFERENCES `vtiger_leaddetails` (`leadid`) ON DELETE CASCADE;

--
-- Constraints for table `gooya_lead_phone`
--
ALTER TABLE `gooya_lead_phone`
  ADD CONSTRAINT `fk_gooya_lead_phone_lead` FOREIGN KEY (`leadid`) REFERENCES `vtiger_leaddetails` (`leadid`) ON DELETE CASCADE;

--
-- Constraints for table `sarv_field_acl_audit`
--
ALTER TABLE `sarv_field_acl_audit`
  ADD CONSTRAINT `fk_sarv_field_acl_audit_rule` FOREIGN KEY (`rule_id`) REFERENCES `sarv_field_acl_rules` (`rule_id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `sarv_field_acl_rules`
--
ALTER TABLE `sarv_field_acl_rules`
  ADD CONSTRAINT `fk_sarv_field_acl_role` FOREIGN KEY (`role_id`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `sarv_geographic_regions`
--
ALTER TABLE `sarv_geographic_regions`
  ADD CONSTRAINT `fk_sarv_geo_parent` FOREIGN KEY (`parent_id`) REFERENCES `sarv_geographic_regions` (`id`);

--
-- Constraints for table `sarv_module_manager_config`
--
ALTER TABLE `sarv_module_manager_config`
  ADD CONSTRAINT `fk_sarv_module_config_user` FOREIGN KEY (`updated_by`) REFERENCES `vtiger_users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `sarv_module_visibility`
--
ALTER TABLE `sarv_module_visibility`
  ADD CONSTRAINT `fk_sarv_module_visibility_tab` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_sarv_module_visibility_user` FOREIGN KEY (`updated_by`) REFERENCES `vtiger_users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `sarv_module_visibility_audit`
--
ALTER TABLE `sarv_module_visibility_audit`
  ADD CONSTRAINT `fk_sarv_module_audit_user` FOREIGN KEY (`changed_by`) REFERENCES `vtiger_users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `sarv_payment_allocation_history`
--
ALTER TABLE `sarv_payment_allocation_history`
  ADD CONSTRAINT `fk_sarv_alloc_history_invoice` FOREIGN KEY (`invoiceid`) REFERENCES `vtiger_invoice` (`invoiceid`),
  ADD CONSTRAINT `fk_sarv_alloc_history_payment` FOREIGN KEY (`paymentid`) REFERENCES `vtiger_sarvpayments` (`sarvpaymentsid`);

--
-- Constraints for table `sarv_payment_allocation_migration_manifest`
--
ALTER TABLE `sarv_payment_allocation_migration_manifest`
  ADD CONSTRAINT `fk_sarv_alloc_manifest_invoice` FOREIGN KEY (`invoiceid`) REFERENCES `vtiger_invoice` (`invoiceid`),
  ADD CONSTRAINT `fk_sarv_alloc_manifest_payment` FOREIGN KEY (`paymentid`) REFERENCES `vtiger_sarvpayments` (`sarvpaymentsid`);

--
-- Constraints for table `sarv_payment_invoice_rel`
--
ALTER TABLE `sarv_payment_invoice_rel`
  ADD CONSTRAINT `fk_sarv_alloc_invoice` FOREIGN KEY (`invoiceid`) REFERENCES `vtiger_invoice` (`invoiceid`),
  ADD CONSTRAINT `fk_sarv_alloc_payment` FOREIGN KEY (`paymentid`) REFERENCES `vtiger_sarvpayments` (`sarvpaymentsid`);

--
-- Constraints for table `sarv_payment_migration_manifest`
--
ALTER TABLE `sarv_payment_migration_manifest`
  ADD CONSTRAINT `fk_sarv_manifest_payment` FOREIGN KEY (`paymentid`) REFERENCES `vtiger_sarvpayments` (`sarvpaymentsid`);

--
-- Constraints for table `sarv_phase03_sample_manifest`
--
ALTER TABLE `sarv_phase03_sample_manifest`
  ADD CONSTRAINT `fk_phase03_manifest_entity` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `sarv_phase04_sample_manifest`
--
ALTER TABLE `sarv_phase04_sample_manifest`
  ADD CONSTRAINT `fk_phase04_manifest_entity` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `sarv_phase05_sample_manifest`
--
ALTER TABLE `sarv_phase05_sample_manifest`
  ADD CONSTRAINT `fk_phase05_manifest_entity` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `sarv_phase06_sample_manifest`
--
ALTER TABLE `sarv_phase06_sample_manifest`
  ADD CONSTRAINT `fk_phase06_manifest_entity` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `sarv_phase07_sample_manifest`
--
ALTER TABLE `sarv_phase07_sample_manifest`
  ADD CONSTRAINT `fk_phase07_manifest_entity` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `sarv_phase08_sample_manifest`
--
ALTER TABLE `sarv_phase08_sample_manifest`
  ADD CONSTRAINT `fk_phase08_manifest_entity` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `sarv_phase09_sample_manifest`
--
ALTER TABLE `sarv_phase09_sample_manifest`
  ADD CONSTRAINT `fk_phase09_manifest_entity` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `sarv_phase10_sample_manifest`
--
ALTER TABLE `sarv_phase10_sample_manifest`
  ADD CONSTRAINT `fk_phase10_manifest_entity` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `sarv_purchaseorder_stock_ledger`
--
ALTER TABLE `sarv_purchaseorder_stock_ledger`
  ADD CONSTRAINT `fk_sarv_po_stock_order` FOREIGN KEY (`purchaseorderid`) REFERENCES `vtiger_purchaseorder` (`purchaseorderid`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_sarv_po_stock_product` FOREIGN KEY (`productid`) REFERENCES `vtiger_products` (`productid`);

--
-- Constraints for table `sarv_role_audit`
--
ALTER TABLE `sarv_role_audit`
  ADD CONSTRAINT `fk_sarv_role_audit_role` FOREIGN KEY (`role_id`) REFERENCES `vtiger_role` (`roleid`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `sarv_role_meta`
--
ALTER TABLE `sarv_role_meta`
  ADD CONSTRAINT `fk_sarv_role_meta_role` FOREIGN KEY (`role_id`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `sarv_role_permission_override`
--
ALTER TABLE `sarv_role_permission_override`
  ADD CONSTRAINT `fk_sarv_role_permission_role` FOREIGN KEY (`role_id`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `sarv_security_group_audit`
--
ALTER TABLE `sarv_security_group_audit`
  ADD CONSTRAINT `fk_sarv_security_group_audit_group` FOREIGN KEY (`group_id`) REFERENCES `vtiger_groups` (`groupid`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `sarv_security_group_meta`
--
ALTER TABLE `sarv_security_group_meta`
  ADD CONSTRAINT `fk_sarv_security_group_meta_group` FOREIGN KEY (`group_id`) REFERENCES `vtiger_groups` (`groupid`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `sarv_stock_movement_ledger`
--
ALTER TABLE `sarv_stock_movement_ledger`
  ADD CONSTRAINT `fk_sarv_stock_product` FOREIGN KEY (`productid`) REFERENCES `vtiger_products` (`productid`),
  ADD CONSTRAINT `fk_sarv_stock_source` FOREIGN KEY (`source_record_id`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `sarv_user_emails`
--
ALTER TABLE `sarv_user_emails`
  ADD CONSTRAINT `fk_sarv_user_emails_user` FOREIGN KEY (`user_id`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `sarv_user_module_layout`
--
ALTER TABLE `sarv_user_module_layout`
  ADD CONSTRAINT `fk_sarv_layout_tab` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE SET NULL,
  ADD CONSTRAINT `fk_sarv_layout_updated_by` FOREIGN KEY (`updated_by`) REFERENCES `vtiger_users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `fk_sarv_layout_user` FOREIGN KEY (`user_id`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `sarv_user_phones`
--
ALTER TABLE `sarv_user_phones`
  ADD CONSTRAINT `fk_sarv_user_phones_user` FOREIGN KEY (`user_id`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `sarv_user_profile`
--
ALTER TABLE `sarv_user_profile`
  ADD CONSTRAINT `fk_sarv_user_profile_geo_region` FOREIGN KEY (`geo_region_id`) REFERENCES `sarv_geographic_regions` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `fk_sarv_user_profile_updated_by` FOREIGN KEY (`updated_by`) REFERENCES `vtiger_users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `fk_sarv_user_profile_user` FOREIGN KEY (`user_id`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `sarv_user_profile_audit`
--
ALTER TABLE `sarv_user_profile_audit`
  ADD CONSTRAINT `fk_sarv_user_audit_by` FOREIGN KEY (`changed_by`) REFERENCES `vtiger_users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `fk_sarv_user_audit_user` FOREIGN KEY (`user_id`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_account`
--
ALTER TABLE `vtiger_account`
  ADD CONSTRAINT `fk_1_vtiger_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_accountbillads`
--
ALTER TABLE `vtiger_accountbillads`
  ADD CONSTRAINT `fk_1_vtiger_accountbillads` FOREIGN KEY (`accountaddressid`) REFERENCES `vtiger_account` (`accountid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_accountscf`
--
ALTER TABLE `vtiger_accountscf`
  ADD CONSTRAINT `fk_1_vtiger_accountscf` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_accountshipads`
--
ALTER TABLE `vtiger_accountshipads`
  ADD CONSTRAINT `fk_1_vtiger_accountshipads` FOREIGN KEY (`accountaddressid`) REFERENCES `vtiger_account` (`accountid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_activity`
--
ALTER TABLE `vtiger_activity`
  ADD CONSTRAINT `fk_1_vtiger_activity` FOREIGN KEY (`activityid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_activitycf`
--
ALTER TABLE `vtiger_activitycf`
  ADD CONSTRAINT `fk_activityid_vtiger_activitycf` FOREIGN KEY (`activityid`) REFERENCES `vtiger_activity` (`activityid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_activityproductrel`
--
ALTER TABLE `vtiger_activityproductrel`
  ADD CONSTRAINT `fk_2_vtiger_activityproductrel` FOREIGN KEY (`productid`) REFERENCES `vtiger_products` (`productid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_activity_reminder`
--
ALTER TABLE `vtiger_activity_reminder`
  ADD CONSTRAINT `fk_activityid_vtiger_activity_reminder` FOREIGN KEY (`activity_id`) REFERENCES `vtiger_activity` (`activityid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_app2tab`
--
ALTER TABLE `vtiger_app2tab`
  ADD CONSTRAINT `vtiger_app2tab_fk_tab` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_assets`
--
ALTER TABLE `vtiger_assets`
  ADD CONSTRAINT `fk_1_vtiger_assets` FOREIGN KEY (`assetsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_assetscf`
--
ALTER TABLE `vtiger_assetscf`
  ADD CONSTRAINT `fk_assetsid_vtiger_assetscf` FOREIGN KEY (`assetsid`) REFERENCES `vtiger_assets` (`assetsid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_attachments`
--
ALTER TABLE `vtiger_attachments`
  ADD CONSTRAINT `fk_1_vtiger_attachments` FOREIGN KEY (`attachmentsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_blocks`
--
ALTER TABLE `vtiger_blocks`
  ADD CONSTRAINT `fk_1_vtiger_blocks` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_campaign`
--
ALTER TABLE `vtiger_campaign`
  ADD CONSTRAINT `fk_crmid_vtiger_campaign` FOREIGN KEY (`campaignid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_campaigncontrel`
--
ALTER TABLE `vtiger_campaigncontrel`
  ADD CONSTRAINT `fk_2_vtiger_campaigncontrel` FOREIGN KEY (`contactid`) REFERENCES `vtiger_contactdetails` (`contactid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_campaignleadrel`
--
ALTER TABLE `vtiger_campaignleadrel`
  ADD CONSTRAINT `fk_2_vtiger_campaignleadrel` FOREIGN KEY (`leadid`) REFERENCES `vtiger_leaddetails` (`leadid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_campaignscf`
--
ALTER TABLE `vtiger_campaignscf`
  ADD CONSTRAINT `fk_1_vtiger_campaignscf` FOREIGN KEY (`campaignid`) REFERENCES `vtiger_campaign` (`campaignid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_cntactivityrel`
--
ALTER TABLE `vtiger_cntactivityrel`
  ADD CONSTRAINT `fk_2_vtiger_cntactivityrel` FOREIGN KEY (`contactid`) REFERENCES `vtiger_contactdetails` (`contactid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_contactaddress`
--
ALTER TABLE `vtiger_contactaddress`
  ADD CONSTRAINT `fk_1_vtiger_contactaddress` FOREIGN KEY (`contactaddressid`) REFERENCES `vtiger_contactdetails` (`contactid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_contactdetails`
--
ALTER TABLE `vtiger_contactdetails`
  ADD CONSTRAINT `fk_1_vtiger_contactdetails` FOREIGN KEY (`contactid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_contactscf`
--
ALTER TABLE `vtiger_contactscf`
  ADD CONSTRAINT `fk_1_vtiger_contactscf` FOREIGN KEY (`contactid`) REFERENCES `vtiger_contactdetails` (`contactid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_contactsubdetails`
--
ALTER TABLE `vtiger_contactsubdetails`
  ADD CONSTRAINT `fk_1_vtiger_contactsubdetails` FOREIGN KEY (`contactsubscriptionid`) REFERENCES `vtiger_contactdetails` (`contactid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_contpotentialrel`
--
ALTER TABLE `vtiger_contpotentialrel`
  ADD CONSTRAINT `fk_2_vtiger_contpotentialrel` FOREIGN KEY (`potentialid`) REFERENCES `vtiger_potential` (`potentialid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_crmentity_user_field`
--
ALTER TABLE `vtiger_crmentity_user_field`
  ADD CONSTRAINT `fk_vtiger_crmentity_user_field_recordid` FOREIGN KEY (`recordid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_customaction`
--
ALTER TABLE `vtiger_customaction`
  ADD CONSTRAINT `fk_1_vtiger_customaction` FOREIGN KEY (`cvid`) REFERENCES `vtiger_customview` (`cvid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_customerdetails`
--
ALTER TABLE `vtiger_customerdetails`
  ADD CONSTRAINT `fk_1_vtiger_customerdetails` FOREIGN KEY (`customerid`) REFERENCES `vtiger_contactdetails` (`contactid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_customview`
--
ALTER TABLE `vtiger_customview`
  ADD CONSTRAINT `fk_1_vtiger_customview` FOREIGN KEY (`entitytype`) REFERENCES `vtiger_tab` (`name`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_cv2group`
--
ALTER TABLE `vtiger_cv2group`
  ADD CONSTRAINT `vtiger_customview_ibfk_2` FOREIGN KEY (`cvid`) REFERENCES `vtiger_customview` (`cvid`) ON DELETE CASCADE,
  ADD CONSTRAINT `vtiger_groups_ibfk_1` FOREIGN KEY (`groupid`) REFERENCES `vtiger_groups` (`groupid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_cv2role`
--
ALTER TABLE `vtiger_cv2role`
  ADD CONSTRAINT `vtiger_customview_ibfk_3` FOREIGN KEY (`cvid`) REFERENCES `vtiger_customview` (`cvid`) ON DELETE CASCADE,
  ADD CONSTRAINT `vtiger_role_ibfk_1` FOREIGN KEY (`roleid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_cv2rs`
--
ALTER TABLE `vtiger_cv2rs`
  ADD CONSTRAINT `vtiger_customview_ibfk_4` FOREIGN KEY (`cvid`) REFERENCES `vtiger_customview` (`cvid`) ON DELETE CASCADE,
  ADD CONSTRAINT `vtiger_rolesd_ibfk_1` FOREIGN KEY (`rsid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_cv2users`
--
ALTER TABLE `vtiger_cv2users`
  ADD CONSTRAINT `vtiger_customview_ibfk_1` FOREIGN KEY (`cvid`) REFERENCES `vtiger_customview` (`cvid`) ON DELETE CASCADE,
  ADD CONSTRAINT `vtiger_users_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_cvadvfilter`
--
ALTER TABLE `vtiger_cvadvfilter`
  ADD CONSTRAINT `fk_1_vtiger_cvadvfilter` FOREIGN KEY (`cvid`) REFERENCES `vtiger_customview` (`cvid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_cvcolumnlist`
--
ALTER TABLE `vtiger_cvcolumnlist`
  ADD CONSTRAINT `fk_1_vtiger_cvcolumnlist` FOREIGN KEY (`cvid`) REFERENCES `vtiger_customview` (`cvid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_cvstdfilter`
--
ALTER TABLE `vtiger_cvstdfilter`
  ADD CONSTRAINT `fk_1_vtiger_cvstdfilter` FOREIGN KEY (`cvid`) REFERENCES `vtiger_customview` (`cvid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_dashboard_tabs`
--
ALTER TABLE `vtiger_dashboard_tabs`
  ADD CONSTRAINT `vtiger_dashboard_tabs_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_datashare_grp2grp`
--
ALTER TABLE `vtiger_datashare_grp2grp`
  ADD CONSTRAINT `fk_3_vtiger_datashare_grp2grp` FOREIGN KEY (`to_groupid`) REFERENCES `vtiger_groups` (`groupid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_datashare_grp2role`
--
ALTER TABLE `vtiger_datashare_grp2role`
  ADD CONSTRAINT `fk_3_vtiger_datashare_grp2role` FOREIGN KEY (`to_roleid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_datashare_grp2rs`
--
ALTER TABLE `vtiger_datashare_grp2rs`
  ADD CONSTRAINT `fk_3_vtiger_datashare_grp2rs` FOREIGN KEY (`to_roleandsubid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_datashare_module_rel`
--
ALTER TABLE `vtiger_datashare_module_rel`
  ADD CONSTRAINT `fk_1_vtiger_datashare_module_rel` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_datashare_relatedmodules`
--
ALTER TABLE `vtiger_datashare_relatedmodules`
  ADD CONSTRAINT `fk_2_vtiger_datashare_relatedmodules` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_datashare_role2group`
--
ALTER TABLE `vtiger_datashare_role2group`
  ADD CONSTRAINT `fk_3_vtiger_datashare_role2group` FOREIGN KEY (`share_roleid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_datashare_role2role`
--
ALTER TABLE `vtiger_datashare_role2role`
  ADD CONSTRAINT `fk_3_vtiger_datashare_role2role` FOREIGN KEY (`to_roleid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_datashare_role2rs`
--
ALTER TABLE `vtiger_datashare_role2rs`
  ADD CONSTRAINT `fk_3_vtiger_datashare_role2rs` FOREIGN KEY (`to_roleandsubid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_datashare_rs2grp`
--
ALTER TABLE `vtiger_datashare_rs2grp`
  ADD CONSTRAINT `fk_3_vtiger_datashare_rs2grp` FOREIGN KEY (`share_roleandsubid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_datashare_rs2role`
--
ALTER TABLE `vtiger_datashare_rs2role`
  ADD CONSTRAINT `fk_3_vtiger_datashare_rs2role` FOREIGN KEY (`to_roleid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_datashare_rs2rs`
--
ALTER TABLE `vtiger_datashare_rs2rs`
  ADD CONSTRAINT `fk_3_vtiger_datashare_rs2rs` FOREIGN KEY (`to_roleandsubid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_defaultcv`
--
ALTER TABLE `vtiger_defaultcv`
  ADD CONSTRAINT `fk_1_vtiger_defaultcv` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_def_org_share`
--
ALTER TABLE `vtiger_def_org_share`
  ADD CONSTRAINT `fk_1_vtiger_def_org_share` FOREIGN KEY (`permission`) REFERENCES `vtiger_org_share_action_mapping` (`share_action_id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_emailslookup`
--
ALTER TABLE `vtiger_emailslookup`
  ADD CONSTRAINT `emailslookup_crmid_fk` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_entityname`
--
ALTER TABLE `vtiger_entityname`
  ADD CONSTRAINT `fk_1_vtiger_entityname` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_faq`
--
ALTER TABLE `vtiger_faq`
  ADD CONSTRAINT `fk_1_vtiger_faq` FOREIGN KEY (`id`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_faqcf`
--
ALTER TABLE `vtiger_faqcf`
  ADD CONSTRAINT `fk_1_vtiger_faqcf` FOREIGN KEY (`faqid`) REFERENCES `vtiger_faq` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_faqcomments`
--
ALTER TABLE `vtiger_faqcomments`
  ADD CONSTRAINT `fk_1_vtiger_faqcomments` FOREIGN KEY (`faqid`) REFERENCES `vtiger_faq` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_field`
--
ALTER TABLE `vtiger_field`
  ADD CONSTRAINT `fk_1_vtiger_field` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_group2grouprel`
--
ALTER TABLE `vtiger_group2grouprel`
  ADD CONSTRAINT `fk_2_vtiger_group2grouprel` FOREIGN KEY (`groupid`) REFERENCES `vtiger_groups` (`groupid`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `vtiger_group2role`
--
ALTER TABLE `vtiger_group2role`
  ADD CONSTRAINT `fk_2_vtiger_group2role` FOREIGN KEY (`roleid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_group2rs`
--
ALTER TABLE `vtiger_group2rs`
  ADD CONSTRAINT `fk_2_vtiger_group2rs` FOREIGN KEY (`roleandsubid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_homedashbd`
--
ALTER TABLE `vtiger_homedashbd`
  ADD CONSTRAINT `fk_1_vtiger_homedashbd` FOREIGN KEY (`stuffid`) REFERENCES `vtiger_homestuff` (`stuffid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_homedefault`
--
ALTER TABLE `vtiger_homedefault`
  ADD CONSTRAINT `fk_1_vtiger_homedefault` FOREIGN KEY (`stuffid`) REFERENCES `vtiger_homestuff` (`stuffid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_homemodule`
--
ALTER TABLE `vtiger_homemodule`
  ADD CONSTRAINT `fk_1_vtiger_homemodule` FOREIGN KEY (`stuffid`) REFERENCES `vtiger_homestuff` (`stuffid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_homemoduleflds`
--
ALTER TABLE `vtiger_homemoduleflds`
  ADD CONSTRAINT `fk_1_vtiger_homemoduleflds` FOREIGN KEY (`stuffid`) REFERENCES `vtiger_homemodule` (`stuffid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_homerss`
--
ALTER TABLE `vtiger_homerss`
  ADD CONSTRAINT `fk_1_vtiger_homerss` FOREIGN KEY (`stuffid`) REFERENCES `vtiger_homestuff` (`stuffid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_homestuff`
--
ALTER TABLE `vtiger_homestuff`
  ADD CONSTRAINT `fk_1_vtiger_homestuff` FOREIGN KEY (`userid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_inventoryproductrel`
--
ALTER TABLE `vtiger_inventoryproductrel`
  ADD CONSTRAINT `fk_crmid_vtiger_inventoryproductrel` FOREIGN KEY (`id`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_invoice`
--
ALTER TABLE `vtiger_invoice`
  ADD CONSTRAINT `fk_2_vtiger_invoice` FOREIGN KEY (`salesorderid`) REFERENCES `vtiger_salesorder` (`salesorderid`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_crmid_vtiger_invoice` FOREIGN KEY (`invoiceid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_invoicebillads`
--
ALTER TABLE `vtiger_invoicebillads`
  ADD CONSTRAINT `fk_1_vtiger_invoicebillads` FOREIGN KEY (`invoicebilladdressid`) REFERENCES `vtiger_invoice` (`invoiceid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_invoicecf`
--
ALTER TABLE `vtiger_invoicecf`
  ADD CONSTRAINT `fk_1_vtiger_invoicecf` FOREIGN KEY (`invoiceid`) REFERENCES `vtiger_invoice` (`invoiceid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_invoiceshipads`
--
ALTER TABLE `vtiger_invoiceshipads`
  ADD CONSTRAINT `fk_1_vtiger_invoiceshipads` FOREIGN KEY (`invoiceshipaddressid`) REFERENCES `vtiger_invoice` (`invoiceid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_invoicestatushistory`
--
ALTER TABLE `vtiger_invoicestatushistory`
  ADD CONSTRAINT `fk_1_vtiger_invoicestatushistory` FOREIGN KEY (`invoiceid`) REFERENCES `vtiger_invoice` (`invoiceid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_invoice_recurring_info`
--
ALTER TABLE `vtiger_invoice_recurring_info`
  ADD CONSTRAINT `fk_salesorderid_vtiger_invoice_recurring_info` FOREIGN KEY (`salesorderid`) REFERENCES `vtiger_salesorder` (`salesorderid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_leadaddress`
--
ALTER TABLE `vtiger_leadaddress`
  ADD CONSTRAINT `fk_1_vtiger_leadaddress` FOREIGN KEY (`leadaddressid`) REFERENCES `vtiger_leaddetails` (`leadid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_leaddetails`
--
ALTER TABLE `vtiger_leaddetails`
  ADD CONSTRAINT `fk_1_vtiger_leaddetails` FOREIGN KEY (`leadid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_leadscf`
--
ALTER TABLE `vtiger_leadscf`
  ADD CONSTRAINT `fk_1_vtiger_leadscf` FOREIGN KEY (`leadid`) REFERENCES `vtiger_leaddetails` (`leadid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_leadsubdetails`
--
ALTER TABLE `vtiger_leadsubdetails`
  ADD CONSTRAINT `fk_1_vtiger_leadsubdetails` FOREIGN KEY (`leadsubscriptionid`) REFERENCES `vtiger_leaddetails` (`leadid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_modcomments`
--
ALTER TABLE `vtiger_modcomments`
  ADD CONSTRAINT `fk_crmid_vtiger_modcomments` FOREIGN KEY (`modcommentsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_modcommentscf`
--
ALTER TABLE `vtiger_modcommentscf`
  ADD CONSTRAINT `fk_modcommentsid_vtiger_modcommentscf` FOREIGN KEY (`modcommentsid`) REFERENCES `vtiger_modcomments` (`modcommentsid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_module_dashboard_widgets`
--
ALTER TABLE `vtiger_module_dashboard_widgets`
  ADD CONSTRAINT `vtiger_module_dashboard_widgets_ibfk_1` FOREIGN KEY (`dashboardtabid`) REFERENCES `vtiger_dashboard_tabs` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_notes`
--
ALTER TABLE `vtiger_notes`
  ADD CONSTRAINT `fk_1_vtiger_notes` FOREIGN KEY (`notesid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_notescf`
--
ALTER TABLE `vtiger_notescf`
  ADD CONSTRAINT `fk_notesid_vtiger_notescf` FOREIGN KEY (`notesid`) REFERENCES `vtiger_notes` (`notesid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_org_share_action2tab`
--
ALTER TABLE `vtiger_org_share_action2tab`
  ADD CONSTRAINT `fk_2_vtiger_org_share_action2tab` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_parenttabrel`
--
ALTER TABLE `vtiger_parenttabrel`
  ADD CONSTRAINT `fk_1_vtiger_parenttabrel` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_2_vtiger_parenttabrel` FOREIGN KEY (`parenttabid`) REFERENCES `vtiger_parenttab` (`parenttabid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_pbxmanager`
--
ALTER TABLE `vtiger_pbxmanager`
  ADD CONSTRAINT `fk_crmid_vtiger_pbxmanager` FOREIGN KEY (`pbxmanagerid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_pbxmanagercf`
--
ALTER TABLE `vtiger_pbxmanagercf`
  ADD CONSTRAINT `fk_pbxmanagerid_vtiger_pbxmanagercf` FOREIGN KEY (`pbxmanagerid`) REFERENCES `vtiger_pbxmanager` (`pbxmanagerid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_pbxmanager_phonelookup`
--
ALTER TABLE `vtiger_pbxmanager_phonelookup`
  ADD CONSTRAINT `vtiger_pbxmanager_phonelookup_ibfk_1` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_pobillads`
--
ALTER TABLE `vtiger_pobillads`
  ADD CONSTRAINT `fk_1_vtiger_pobillads` FOREIGN KEY (`pobilladdressid`) REFERENCES `vtiger_purchaseorder` (`purchaseorderid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_poshipads`
--
ALTER TABLE `vtiger_poshipads`
  ADD CONSTRAINT `fk_1_vtiger_poshipads` FOREIGN KEY (`poshipaddressid`) REFERENCES `vtiger_purchaseorder` (`purchaseorderid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_postatushistory`
--
ALTER TABLE `vtiger_postatushistory`
  ADD CONSTRAINT `fk_1_vtiger_postatushistory` FOREIGN KEY (`purchaseorderid`) REFERENCES `vtiger_purchaseorder` (`purchaseorderid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_potential`
--
ALTER TABLE `vtiger_potential`
  ADD CONSTRAINT `fk_1_vtiger_potential` FOREIGN KEY (`potentialid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_potentialscf`
--
ALTER TABLE `vtiger_potentialscf`
  ADD CONSTRAINT `fk_1_vtiger_potentialscf` FOREIGN KEY (`potentialid`) REFERENCES `vtiger_potential` (`potentialid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_potstagehistory`
--
ALTER TABLE `vtiger_potstagehistory`
  ADD CONSTRAINT `fk_1_vtiger_potstagehistory` FOREIGN KEY (`potentialid`) REFERENCES `vtiger_potential` (`potentialid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_pricebook`
--
ALTER TABLE `vtiger_pricebook`
  ADD CONSTRAINT `fk_1_vtiger_pricebook` FOREIGN KEY (`pricebookid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_pricebookcf`
--
ALTER TABLE `vtiger_pricebookcf`
  ADD CONSTRAINT `fk_1_vtiger_pricebookcf` FOREIGN KEY (`pricebookid`) REFERENCES `vtiger_pricebook` (`pricebookid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_pricebookproductrel`
--
ALTER TABLE `vtiger_pricebookproductrel`
  ADD CONSTRAINT `fk_1_vtiger_pricebookproductrel` FOREIGN KEY (`pricebookid`) REFERENCES `vtiger_pricebook` (`pricebookid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_productcf`
--
ALTER TABLE `vtiger_productcf`
  ADD CONSTRAINT `fk_1_vtiger_productcf` FOREIGN KEY (`productid`) REFERENCES `vtiger_products` (`productid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_products`
--
ALTER TABLE `vtiger_products`
  ADD CONSTRAINT `fk_1_vtiger_products` FOREIGN KEY (`productid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_producttaxrel`
--
ALTER TABLE `vtiger_producttaxrel`
  ADD CONSTRAINT `fk_crmid_vtiger_producttaxrel` FOREIGN KEY (`productid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_profile2globalpermissions`
--
ALTER TABLE `vtiger_profile2globalpermissions`
  ADD CONSTRAINT `fk_1_vtiger_profile2globalpermissions` FOREIGN KEY (`profileid`) REFERENCES `vtiger_profile` (`profileid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_project`
--
ALTER TABLE `vtiger_project`
  ADD CONSTRAINT `fk_crmid_vtiger_project` FOREIGN KEY (`projectid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_projectcf`
--
ALTER TABLE `vtiger_projectcf`
  ADD CONSTRAINT `fk_projectid_vtiger_projectcf` FOREIGN KEY (`projectid`) REFERENCES `vtiger_project` (`projectid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_projectmilestone`
--
ALTER TABLE `vtiger_projectmilestone`
  ADD CONSTRAINT `fk_crmid_vtiger_projectmilestone` FOREIGN KEY (`projectmilestoneid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_projectmilestonecf`
--
ALTER TABLE `vtiger_projectmilestonecf`
  ADD CONSTRAINT `fk_projectmilestoneid_vtiger_projectmilestonecf` FOREIGN KEY (`projectmilestoneid`) REFERENCES `vtiger_projectmilestone` (`projectmilestoneid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_projecttask`
--
ALTER TABLE `vtiger_projecttask`
  ADD CONSTRAINT `fk_crmid_vtiger_projecttask` FOREIGN KEY (`projecttaskid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_projecttaskcf`
--
ALTER TABLE `vtiger_projecttaskcf`
  ADD CONSTRAINT `fk_projecttaskid_vtiger_projecttaskcf` FOREIGN KEY (`projecttaskid`) REFERENCES `vtiger_projecttask` (`projecttaskid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_purchaseorder`
--
ALTER TABLE `vtiger_purchaseorder`
  ADD CONSTRAINT `fk_4_vtiger_purchaseorder` FOREIGN KEY (`vendorid`) REFERENCES `vtiger_vendor` (`vendorid`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_crmid_vtiger_purchaseorder` FOREIGN KEY (`purchaseorderid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_sarv_purchaseorder_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`) ON DELETE SET NULL;

--
-- Constraints for table `vtiger_purchaseordercf`
--
ALTER TABLE `vtiger_purchaseordercf`
  ADD CONSTRAINT `fk_1_vtiger_purchaseordercf` FOREIGN KEY (`purchaseorderid`) REFERENCES `vtiger_purchaseorder` (`purchaseorderid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_quotes`
--
ALTER TABLE `vtiger_quotes`
  ADD CONSTRAINT `fk_3_vtiger_quotes` FOREIGN KEY (`potentialid`) REFERENCES `vtiger_potential` (`potentialid`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_crmid_vtiger_quotes` FOREIGN KEY (`quoteid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_quotesbillads`
--
ALTER TABLE `vtiger_quotesbillads`
  ADD CONSTRAINT `fk_1_vtiger_quotesbillads` FOREIGN KEY (`quotebilladdressid`) REFERENCES `vtiger_quotes` (`quoteid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_quotescf`
--
ALTER TABLE `vtiger_quotescf`
  ADD CONSTRAINT `fk_1_vtiger_quotescf` FOREIGN KEY (`quoteid`) REFERENCES `vtiger_quotes` (`quoteid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_quotesshipads`
--
ALTER TABLE `vtiger_quotesshipads`
  ADD CONSTRAINT `fk_1_vtiger_quotesshipads` FOREIGN KEY (`quoteshipaddressid`) REFERENCES `vtiger_quotes` (`quoteid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_quotestagehistory`
--
ALTER TABLE `vtiger_quotestagehistory`
  ADD CONSTRAINT `fk_1_vtiger_quotestagehistory` FOREIGN KEY (`quoteid`) REFERENCES `vtiger_quotes` (`quoteid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_recurringevents`
--
ALTER TABLE `vtiger_recurringevents`
  ADD CONSTRAINT `fk_1_vtiger_recurringevents` FOREIGN KEY (`activityid`) REFERENCES `vtiger_activity` (`activityid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_relcriteria`
--
ALTER TABLE `vtiger_relcriteria`
  ADD CONSTRAINT `fk_1_vtiger_relcriteria` FOREIGN KEY (`queryid`) REFERENCES `vtiger_selectquery` (`queryid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_report`
--
ALTER TABLE `vtiger_report`
  ADD CONSTRAINT `fk_2_vtiger_report` FOREIGN KEY (`queryid`) REFERENCES `vtiger_selectquery` (`queryid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_reportdatefilter`
--
ALTER TABLE `vtiger_reportdatefilter`
  ADD CONSTRAINT `fk_1_vtiger_reportdatefilter` FOREIGN KEY (`datefilterid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_reportgroupbycolumn`
--
ALTER TABLE `vtiger_reportgroupbycolumn`
  ADD CONSTRAINT `fk_1_vtiger_reportgroupbycolumn` FOREIGN KEY (`reportid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_reportmodules`
--
ALTER TABLE `vtiger_reportmodules`
  ADD CONSTRAINT `fk_1_vtiger_reportmodules` FOREIGN KEY (`reportmodulesid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_reportsortcol`
--
ALTER TABLE `vtiger_reportsortcol`
  ADD CONSTRAINT `fk_1_vtiger_reportsortcol` FOREIGN KEY (`reportid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_reportsummary`
--
ALTER TABLE `vtiger_reportsummary`
  ADD CONSTRAINT `fk_1_vtiger_reportsummary` FOREIGN KEY (`reportsummaryid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_reporttype`
--
ALTER TABLE `vtiger_reporttype`
  ADD CONSTRAINT `fk_1_vtiger_reporttype` FOREIGN KEY (`reportid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_report_sharegroups`
--
ALTER TABLE `vtiger_report_sharegroups`
  ADD CONSTRAINT `vtiger_groups_groupid_ibfk_1` FOREIGN KEY (`groupid`) REFERENCES `vtiger_groups` (`groupid`) ON DELETE CASCADE,
  ADD CONSTRAINT `vtiger_report_reportid_ibfk_2` FOREIGN KEY (`reportid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_report_sharerole`
--
ALTER TABLE `vtiger_report_sharerole`
  ADD CONSTRAINT `vtiger_report_reportid_ibfk_3` FOREIGN KEY (`reportid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE,
  ADD CONSTRAINT `vtiger_role_roleid_ibfk_1` FOREIGN KEY (`roleid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_report_sharers`
--
ALTER TABLE `vtiger_report_sharers`
  ADD CONSTRAINT `vtiger_report_reportid_ibfk_4` FOREIGN KEY (`reportid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE,
  ADD CONSTRAINT `vtiger_rolesd_rsid_ibfk_1` FOREIGN KEY (`rsid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_report_shareusers`
--
ALTER TABLE `vtiger_report_shareusers`
  ADD CONSTRAINT `vtiger_reports_reportid_ibfk_1` FOREIGN KEY (`reportid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE,
  ADD CONSTRAINT `vtiger_users_userid_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_role2picklist`
--
ALTER TABLE `vtiger_role2picklist`
  ADD CONSTRAINT `fk_1_vtiger_role2picklist` FOREIGN KEY (`roleid`) REFERENCES `vtiger_role` (`roleid`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_2_vtiger_role2picklist` FOREIGN KEY (`picklistid`) REFERENCES `vtiger_picklist` (`picklistid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_salesmanactivityrel`
--
ALTER TABLE `vtiger_salesmanactivityrel`
  ADD CONSTRAINT `fk_2_vtiger_salesmanactivityrel` FOREIGN KEY (`smid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_salesmanattachmentsrel`
--
ALTER TABLE `vtiger_salesmanattachmentsrel`
  ADD CONSTRAINT `fk_2_vtiger_salesmanattachmentsrel` FOREIGN KEY (`attachmentsid`) REFERENCES `vtiger_attachments` (`attachmentsid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_salesmanticketrel`
--
ALTER TABLE `vtiger_salesmanticketrel`
  ADD CONSTRAINT `fk_2_vtiger_salesmanticketrel` FOREIGN KEY (`smid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_salesorder`
--
ALTER TABLE `vtiger_salesorder`
  ADD CONSTRAINT `fk_3_vtiger_salesorder` FOREIGN KEY (`vendorid`) REFERENCES `vtiger_vendor` (`vendorid`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_crmid_vtiger_salesorder` FOREIGN KEY (`salesorderid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_salesordercf`
--
ALTER TABLE `vtiger_salesordercf`
  ADD CONSTRAINT `fk_1_vtiger_salesordercf` FOREIGN KEY (`salesorderid`) REFERENCES `vtiger_salesorder` (`salesorderid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_sarvaccessgrants`
--
ALTER TABLE `vtiger_sarvaccessgrants`
  ADD CONSTRAINT `fk_sarvaccessgrant_group` FOREIGN KEY (`groupid`) REFERENCES `vtiger_groups` (`groupid`),
  ADD CONSTRAINT `fk_sarvaccessgrants_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`),
  ADD CONSTRAINT `fk_sarvaccessgrants_entity` FOREIGN KEY (`sarvaccessgrantsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_sarvbusinesslocations`
--
ALTER TABLE `vtiger_sarvbusinesslocations`
  ADD CONSTRAINT `fk_sarvbusinesslocations_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`),
  ADD CONSTRAINT `fk_sarvbusinesslocations_entity` FOREIGN KEY (`sarvbusinesslocationsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_sarvlocation_manager` FOREIGN KEY (`managercontactid`) REFERENCES `vtiger_contactdetails` (`contactid`),
  ADD CONSTRAINT `fk_sarvlocation_parent` FOREIGN KEY (`parentlocationid`) REFERENCES `vtiger_sarvbusinesslocations` (`sarvbusinesslocationsid`);

--
-- Constraints for table `vtiger_sarvdeposits`
--
ALTER TABLE `vtiger_sarvdeposits`
  ADD CONSTRAINT `fk_sarvdeposits_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`),
  ADD CONSTRAINT `fk_sarvdeposits_currency` FOREIGN KEY (`currency_id`) REFERENCES `vtiger_currency_info` (`id`),
  ADD CONSTRAINT `fk_sarvdeposits_entity` FOREIGN KEY (`sarvdepositsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_sarvgifts`
--
ALTER TABLE `vtiger_sarvgifts`
  ADD CONSTRAINT `fk_sarvgift_campaign` FOREIGN KEY (`campaignid`) REFERENCES `vtiger_campaign` (`campaignid`),
  ADD CONSTRAINT `fk_sarvgift_contact` FOREIGN KEY (`contactid`) REFERENCES `vtiger_contactdetails` (`contactid`),
  ADD CONSTRAINT `fk_sarvgift_product` FOREIGN KEY (`productid`) REFERENCES `vtiger_products` (`productid`),
  ADD CONSTRAINT `fk_sarvgifts_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`),
  ADD CONSTRAINT `fk_sarvgifts_entity` FOREIGN KEY (`sarvgiftsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_sarvparticipations`
--
ALTER TABLE `vtiger_sarvparticipations`
  ADD CONSTRAINT `fk_sarvparticipations_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`),
  ADD CONSTRAINT `fk_sarvparticipations_entity` FOREIGN KEY (`sarvparticipationsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_sarvproductsamples`
--
ALTER TABLE `vtiger_sarvproductsamples`
  ADD CONSTRAINT `fk_sarvproductsamples_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`),
  ADD CONSTRAINT `fk_sarvproductsamples_entity` FOREIGN KEY (`sarvproductsamplesid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_sarvsample_campaign` FOREIGN KEY (`campaignid`) REFERENCES `vtiger_campaign` (`campaignid`),
  ADD CONSTRAINT `fk_sarvsample_contact` FOREIGN KEY (`contactid`) REFERENCES `vtiger_contactdetails` (`contactid`),
  ADD CONSTRAINT `fk_sarvsample_potential` FOREIGN KEY (`potentialid`) REFERENCES `vtiger_potential` (`potentialid`),
  ADD CONSTRAINT `fk_sarvsample_product` FOREIGN KEY (`productid`) REFERENCES `vtiger_products` (`productid`);

--
-- Constraints for table `vtiger_sarvsalescontracts`
--
ALTER TABLE `vtiger_sarvsalescontracts`
  ADD CONSTRAINT `fk_sarvsalescontracts_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`),
  ADD CONSTRAINT `fk_sarvsalescontracts_entity` FOREIGN KEY (`sarvsalescontractsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_sarvsurveyresponses`
--
ALTER TABLE `vtiger_sarvsurveyresponses`
  ADD CONSTRAINT `fk_sarvsurveyresponses_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`),
  ADD CONSTRAINT `fk_sarvsurveyresponses_entity` FOREIGN KEY (`sarvsurveyresponsesid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_sarvtargetlists`
--
ALTER TABLE `vtiger_sarvtargetlists`
  ADD CONSTRAINT `fk_sarvtargetlists_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_account` (`accountid`),
  ADD CONSTRAINT `fk_sarvtargetlists_entity` FOREIGN KEY (`sarvtargetlistsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_seactivityrel`
--
ALTER TABLE `vtiger_seactivityrel`
  ADD CONSTRAINT `fk_2_vtiger_seactivityrel` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_seattachmentsrel`
--
ALTER TABLE `vtiger_seattachmentsrel`
  ADD CONSTRAINT `fk_2_vtiger_seattachmentsrel` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_selectcolumn`
--
ALTER TABLE `vtiger_selectcolumn`
  ADD CONSTRAINT `fk_1_vtiger_selectcolumn` FOREIGN KEY (`queryid`) REFERENCES `vtiger_selectquery` (`queryid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_senotesrel`
--
ALTER TABLE `vtiger_senotesrel`
  ADD CONSTRAINT `fk1_crmid` FOREIGN KEY (`crmid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_2_vtiger_senotesrel` FOREIGN KEY (`notesid`) REFERENCES `vtiger_notes` (`notesid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_seproductsrel`
--
ALTER TABLE `vtiger_seproductsrel`
  ADD CONSTRAINT `fk_2_vtiger_seproductsrel` FOREIGN KEY (`productid`) REFERENCES `vtiger_products` (`productid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_service`
--
ALTER TABLE `vtiger_service`
  ADD CONSTRAINT `fk_1_vtiger_service` FOREIGN KEY (`serviceid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_servicecf`
--
ALTER TABLE `vtiger_servicecf`
  ADD CONSTRAINT `fk_serviceid_vtiger_servicecf` FOREIGN KEY (`serviceid`) REFERENCES `vtiger_service` (`serviceid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_servicecontracts`
--
ALTER TABLE `vtiger_servicecontracts`
  ADD CONSTRAINT `fk_crmid_vtiger_servicecontracts` FOREIGN KEY (`servicecontractsid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_servicecontractscf`
--
ALTER TABLE `vtiger_servicecontractscf`
  ADD CONSTRAINT `fk_servicecontractsid_vtiger_servicecontractscf` FOREIGN KEY (`servicecontractsid`) REFERENCES `vtiger_servicecontracts` (`servicecontractsid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_seticketsrel`
--
ALTER TABLE `vtiger_seticketsrel`
  ADD CONSTRAINT `fk_2_vtiger_seticketsrel` FOREIGN KEY (`ticketid`) REFERENCES `vtiger_troubletickets` (`ticketid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_settings_field`
--
ALTER TABLE `vtiger_settings_field`
  ADD CONSTRAINT `fk_1_vtiger_settings_field` FOREIGN KEY (`blockid`) REFERENCES `vtiger_settings_blocks` (`blockid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_smsnotifier`
--
ALTER TABLE `vtiger_smsnotifier`
  ADD CONSTRAINT `fk_crmid_vtiger_smsnotifier` FOREIGN KEY (`smsnotifierid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_smsnotifiercf`
--
ALTER TABLE `vtiger_smsnotifiercf`
  ADD CONSTRAINT `fk_smsnotifierid_vtiger_smsnotifiercf` FOREIGN KEY (`smsnotifierid`) REFERENCES `vtiger_smsnotifier` (`smsnotifierid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_sobillads`
--
ALTER TABLE `vtiger_sobillads`
  ADD CONSTRAINT `fk_1_vtiger_sobillads` FOREIGN KEY (`sobilladdressid`) REFERENCES `vtiger_salesorder` (`salesorderid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_soshipads`
--
ALTER TABLE `vtiger_soshipads`
  ADD CONSTRAINT `fk_1_vtiger_soshipads` FOREIGN KEY (`soshipaddressid`) REFERENCES `vtiger_salesorder` (`salesorderid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_sostatushistory`
--
ALTER TABLE `vtiger_sostatushistory`
  ADD CONSTRAINT `fk_1_vtiger_sostatushistory` FOREIGN KEY (`salesorderid`) REFERENCES `vtiger_salesorder` (`salesorderid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_tab_info`
--
ALTER TABLE `vtiger_tab_info`
  ADD CONSTRAINT `fk_1_vtiger_tab_info` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `vtiger_ticketcf`
--
ALTER TABLE `vtiger_ticketcf`
  ADD CONSTRAINT `fk_1_vtiger_ticketcf` FOREIGN KEY (`ticketid`) REFERENCES `vtiger_troubletickets` (`ticketid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_ticketcomments`
--
ALTER TABLE `vtiger_ticketcomments`
  ADD CONSTRAINT `fk_1_vtiger_ticketcomments` FOREIGN KEY (`ticketid`) REFERENCES `vtiger_troubletickets` (`ticketid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_tmp_read_group_rel_sharing_per`
--
ALTER TABLE `vtiger_tmp_read_group_rel_sharing_per`
  ADD CONSTRAINT `fk_4_vtiger_tmp_read_group_rel_sharing_per` FOREIGN KEY (`userid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_tmp_read_group_sharing_per`
--
ALTER TABLE `vtiger_tmp_read_group_sharing_per`
  ADD CONSTRAINT `fk_3_vtiger_tmp_read_group_sharing_per` FOREIGN KEY (`userid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_tmp_read_user_rel_sharing_per`
--
ALTER TABLE `vtiger_tmp_read_user_rel_sharing_per`
  ADD CONSTRAINT `fk_4_vtiger_tmp_read_user_rel_sharing_per` FOREIGN KEY (`userid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_tmp_read_user_sharing_per`
--
ALTER TABLE `vtiger_tmp_read_user_sharing_per`
  ADD CONSTRAINT `fk_3_vtiger_tmp_read_user_sharing_per` FOREIGN KEY (`userid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_tmp_write_group_rel_sharing_per`
--
ALTER TABLE `vtiger_tmp_write_group_rel_sharing_per`
  ADD CONSTRAINT `fk_4_vtiger_tmp_write_group_rel_sharing_per` FOREIGN KEY (`userid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_tmp_write_group_sharing_per`
--
ALTER TABLE `vtiger_tmp_write_group_sharing_per`
  ADD CONSTRAINT `fk_3_vtiger_tmp_write_group_sharing_per` FOREIGN KEY (`userid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_tmp_write_user_rel_sharing_per`
--
ALTER TABLE `vtiger_tmp_write_user_rel_sharing_per`
  ADD CONSTRAINT `fk_4_vtiger_tmp_write_user_rel_sharing_per` FOREIGN KEY (`userid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_tmp_write_user_sharing_per`
--
ALTER TABLE `vtiger_tmp_write_user_sharing_per`
  ADD CONSTRAINT `fk_3_vtiger_tmp_write_user_sharing_per` FOREIGN KEY (`userid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_troubletickets`
--
ALTER TABLE `vtiger_troubletickets`
  ADD CONSTRAINT `fk_1_vtiger_troubletickets` FOREIGN KEY (`ticketid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_user2role`
--
ALTER TABLE `vtiger_user2role`
  ADD CONSTRAINT `fk_2_vtiger_user2role` FOREIGN KEY (`userid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_users2group`
--
ALTER TABLE `vtiger_users2group`
  ADD CONSTRAINT `fk_2_vtiger_users2group` FOREIGN KEY (`userid`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_user_module_preferences`
--
ALTER TABLE `vtiger_user_module_preferences`
  ADD CONSTRAINT `fk_2_vtiger_user_module_preferences` FOREIGN KEY (`tabid`) REFERENCES `vtiger_tab` (`tabid`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `vtiger_vendor`
--
ALTER TABLE `vtiger_vendor`
  ADD CONSTRAINT `fk_1_vtiger_vendor` FOREIGN KEY (`vendorid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_vendorcf`
--
ALTER TABLE `vtiger_vendorcf`
  ADD CONSTRAINT `fk_1_vtiger_vendorcf` FOREIGN KEY (`vendorid`) REFERENCES `vtiger_vendor` (`vendorid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_vendorcontactrel`
--
ALTER TABLE `vtiger_vendorcontactrel`
  ADD CONSTRAINT `fk_2_vtiger_vendorcontactrel` FOREIGN KEY (`vendorid`) REFERENCES `vtiger_vendor` (`vendorid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_webforms_field`
--
ALTER TABLE `vtiger_webforms_field`
  ADD CONSTRAINT `fk_1_vtiger_webforms_field` FOREIGN KEY (`webformid`) REFERENCES `vtiger_webforms` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_4_vtiger_webforms_field` FOREIGN KEY (`fieldid`) REFERENCES `vtiger_field` (`fieldid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_webform_file_fields`
--
ALTER TABLE `vtiger_webform_file_fields`
  ADD CONSTRAINT `fk_vtiger_webforms` FOREIGN KEY (`webformid`) REFERENCES `vtiger_webforms` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_wsapp_logs_details`
--
ALTER TABLE `vtiger_wsapp_logs_details`
  ADD CONSTRAINT `vtiger_wsapp_logs_basic_ibfk_1` FOREIGN KEY (`id`) REFERENCES `vtiger_wsapp_logs_basic` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_ws_entity_referencetype`
--
ALTER TABLE `vtiger_ws_entity_referencetype`
  ADD CONSTRAINT `vtiger_fk_1_actors_referencetype` FOREIGN KEY (`fieldtypeid`) REFERENCES `vtiger_ws_entity_fieldtype` (`fieldtypeid`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_ws_entity_tables`
--
ALTER TABLE `vtiger_ws_entity_tables`
  ADD CONSTRAINT `fk_1_vtiger_ws_actor_tables` FOREIGN KEY (`webservice_entity_id`) REFERENCES `vtiger_ws_entity` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vtiger_ws_referencetype`
--
ALTER TABLE `vtiger_ws_referencetype`
  ADD CONSTRAINT `fk_1_vtiger_referencetype` FOREIGN KEY (`fieldtypeid`) REFERENCES `vtiger_ws_fieldtype` (`fieldtypeid`) ON DELETE CASCADE;
COMMIT;

