CREATE TABLE `tbltenantspecific_supplier` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8_unicode_ci NOT NULL,
  `image` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
  `email` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
  `phone` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
  `street_1` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
  `street_2` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
  `city` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
  `state` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
  `zip` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
  `country` bigint(20) UNSIGNED DEFAULT NULL,
  `is_active` bigint(20) UNSIGNED DEFAULT "1",
  `addedfrom` bigint(20) UNSIGNED DEFAULT NULL,
  `datecreated` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

ALTER TABLE `tbltenantspecific_supplier`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tenant_id` (`tenant_id`),
  ADD KEY `country` (`country`),
  ADD KEY `addedfrom` (`addedfrom`);

ALTER TABLE `tbltenantspecific_supplier`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;


CREATE TABLE `tbltenantspecific_supply_category` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenant_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8_unicode_ci NOT NULL,
  `is_active` bigint(20) UNSIGNED DEFAULT "1",
  `addedfrom` bigint(20) UNSIGNED DEFAULT NULL,
  `datecreated` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

ALTER TABLE `tbltenantspecific_supply_category`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tenant_id` (`tenant_id`),
  ADD KEY `addedfrom` (`addedfrom`);

ALTER TABLE `tbltenantspecific_supply_category`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;


CREATE TABLE `tbltenantspecific_supplies` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tenantspecific_supplier_id` bigint(20) UNSIGNED NOT NULL,
  `tenantspecific_supply_category_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8_unicode_ci NOT NULL,
  `image` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
  `price` decimal(15,2) DEFAULT "0.00",
  `is_active` bigint(20) UNSIGNED DEFAULT "1",
  `addedfrom` bigint(20) UNSIGNED DEFAULT NULL,
  `datecreated` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

ALTER TABLE `tbltenantspecific_supplies`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tenantspecific_supplier_id` (`tenantspecific_supplier_id`),
  ADD KEY `tenantspecific_supply_category_id` (`tenantspecific_supply_category_id`),
  ADD KEY `addedfrom` (`addedfrom`);

ALTER TABLE `tbltenantspecific_supplies`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;


CREATE TABLE `tblsystemwide_supplier` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8_unicode_ci NOT NULL,
  `image` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
  `is_active` bigint(20) UNSIGNED DEFAULT "1",
  `addedfrom` bigint(20) UNSIGNED DEFAULT NULL,
  `datecreated` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

ALTER TABLE `tblsystemwide_supplier`
  ADD PRIMARY KEY (`id`),
  ADD KEY `addedfrom` (`addedfrom`);

ALTER TABLE `tblsystemwide_supplier`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;


CREATE TABLE `tblsystemwide_supply_category` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8_unicode_ci NOT NULL,
  `is_active` bigint(20) UNSIGNED DEFAULT "1",
  `addedfrom` bigint(20) UNSIGNED DEFAULT NULL,
  `datecreated` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

ALTER TABLE `tblsystemwide_supply_category`
  ADD PRIMARY KEY (`id`),
  ADD KEY `addedfrom` (`addedfrom`);

ALTER TABLE `tblsystemwide_supply_category`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;


CREATE TABLE `tblsystemwide_supplies` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `systemwide_supplier_id` bigint(20) UNSIGNED NOT NULL,
  `systemwide_supply_category_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8_unicode_ci NOT NULL,
  `image` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
  `price` decimal(15,2) DEFAULT "0.00",
  `is_active` bigint(20) UNSIGNED DEFAULT "1",
  `addedfrom` bigint(20) UNSIGNED DEFAULT NULL,
  `datecreated` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

ALTER TABLE `tblsystemwide_supplies`
  ADD PRIMARY KEY (`id`),
  ADD KEY `systemwide_supplier_id` (`systemwide_supplier_id`),
  ADD KEY `systemwide_supply_category_id` (`systemwide_supply_category_id`),
  ADD KEY `addedfrom` (`addedfrom`);

ALTER TABLE `tblsystemwide_supplies`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;