-- --------------------------------------------------------
-- Server OS:                    Win64
-- HeidiSQL Version:             12.1.0.6537
-- --------------------------------------------------------


-- Dumping structure for table waffle.attendances
CREATE TABLE IF NOT EXISTS `attendances` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `date_time` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `attendances_user_id_foreign` (`user_id`),
  KEY `attendances_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `attendances_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `attendances_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.attendances: ~0 rows (approximately)

-- Dumping structure for table waffle.bills
CREATE TABLE IF NOT EXISTS `bills` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `payment_type_id` bigint unsigned DEFAULT NULL,
  `order_source_id` bigint unsigned DEFAULT NULL,
  `table_id` bigint unsigned DEFAULT NULL,
  `amount` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `discount` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gst` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_parcel` tinyint(1) NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '0',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `bills_user_id_foreign` (`user_id`),
  KEY `bills_franchise_id_foreign` (`franchise_id`),
  KEY `bills_payment_type_id_foreign` (`payment_type_id`),
  KEY `bills_order_source_id_foreign` (`order_source_id`),
  KEY `bills_table_id_foreign` (`table_id`),
  CONSTRAINT `bills_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `bills_order_source_id_foreign` FOREIGN KEY (`order_source_id`) REFERENCES `order_sources` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `bills_payment_type_id_foreign` FOREIGN KEY (`payment_type_id`) REFERENCES `payment_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `bills_table_id_foreign` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `bills_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.bills: ~0 rows (approximately)

-- Dumping structure for table waffle.bill_details
CREATE TABLE IF NOT EXISTS `bill_details` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `bill_id` bigint unsigned DEFAULT NULL,
  `recipe_id` bigint unsigned DEFAULT NULL,
  `qty` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` int DEFAULT NULL,
  `total_amount` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `bill_details_user_id_foreign` (`user_id`),
  KEY `bill_details_bill_id_foreign` (`bill_id`),
  KEY `bill_details_recipe_id_foreign` (`recipe_id`),
  CONSTRAINT `bill_details_bill_id_foreign` FOREIGN KEY (`bill_id`) REFERENCES `bills` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `bill_details_recipe_id_foreign` FOREIGN KEY (`recipe_id`) REFERENCES `recipes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `bill_details_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.cache_locks: ~0 rows (approximately)

-- Dumping structure for table waffle.expenses
CREATE TABLE IF NOT EXISTS `expenses` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `expense_type_id` bigint unsigned DEFAULT NULL,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amount` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expenses_expense_type_id_foreign` (`expense_type_id`),
  KEY `expenses_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `expenses_expense_type_id_foreign` FOREIGN KEY (`expense_type_id`) REFERENCES `expense_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `expenses_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.expenses: ~0 rows (approximately)

-- Dumping structure for table waffle.expense_types
CREATE TABLE IF NOT EXISTS `expense_types` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `expense_types_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `expense_types_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.expense_types: ~0 rows (approximately)

-- Dumping structure for table waffle.franchises
CREATE TABLE IF NOT EXISTS `franchises` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `master_franchise_id` bigint unsigned DEFAULT NULL,
  `shop_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mobile` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `landmark` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pincode` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gst` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cgst` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `photo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_contact` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_dob` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shop_opening_date` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `franchise_amount` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `master_commission_percent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `renewal_date` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_master` tinyint(1) NOT NULL DEFAULT '0',
  `is_active` tinyint(1) NOT NULL DEFAULT '0',
  `is_approved` tinyint(1) NOT NULL DEFAULT '0',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `franchises_master_franchise_id_foreign` (`master_franchise_id`),
  CONSTRAINT `franchises_master_franchise_id_foreign` FOREIGN KEY (`master_franchise_id`) REFERENCES `master_franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.franchises: ~6 rows (approximately)
INSERT INTO `franchises` (`id`, `master_franchise_id`, `shop_name`, `user_name`, `email`, `mobile`, `address`, `landmark`, `city`, `country`, `state`, `pincode`, `gst`, `cgst`, `photo`, `user_contact`, `user_dob`, `shop_opening_date`, `franchise_amount`, `master_commission_percent`, `renewal_date`, `is_master`, `is_active`, `is_approved`, `deleted_at`, `created_at`, `updated_at`) VALUES
	(1, 1, 'Test franchise 1', 'eichmann.roel', 'bednar.marietta@example.org', '+1-678-968-9999', '2516 Henderson Village Apt. 925\nLake Lenoreland, NH 18531-3675', 'quidem', 'Virgiltown', 'Gambia', 'corrupti', 'incidunt', '68748914', '55602576', NULL, '+1-219-204-4468', '30-08-2024', '30-08-2024', '588033', '18', 'et', 1, 1, 1, NULL, '2024-08-30 04:25:21', '2024-08-30 04:25:21'),
	(2, 1, 'Test franchise 2', 'anjali.boyer', 'anibal13@example.net', '864-449-7443', '9369 Caden Tunnel Suite 369\nEarlenefort, WV 43569-3982', 'velit', 'East Esperanza', 'Isle of Man', 'tempore', 'non', '71320760', '54030362', NULL, '+15317695309', '30-08-2024', '30-08-2024', '294527', '13', 'qui', 0, 1, 1, NULL, '2024-08-30 04:25:22', '2024-08-30 04:25:22'),
	(3, 1, 'Test franchise 3', 'mills.marc', 'schulist.marlene@example.net', '(520) 994-1508', '112 Sydnie Junction Apt. 498\nPort Aracelyton, IA 40652-5768', 'aut', 'East Javonte', 'Seychelles', 'repellendus', 'quo', '87504459', '36758519', NULL, '+1 (385) 403-9320', '30-08-2024', '30-08-2024', '980983', '20', 'cumque', 0, 1, 1, NULL, '2024-08-30 04:25:22', '2024-08-30 04:25:22'),
	(4, 1, 'Test franchise 4', 'george.willms', 'stracke.ted@example.net', '(743) 417-9429', '478 Littel Ford\nAbemouth, NV 55709', 'iste', 'Nelleborough', 'Equatorial Guinea', 'tempore', 'voluptatibus', '46191868', '70895434', NULL, '949-527-8210', '30-08-2024', '30-08-2024', '944421', '14', 'ratione', 0, 1, 1, NULL, '2024-08-30 04:25:23', '2024-08-30 04:25:23'),
	(5, 4, 'Test franchise shop', 'Test Franchise User', 'test2@uditsolutions.com', '9136248458', 'test address', NULL, 'mumbai', 'india', NULL, '400071', NULL, NULL, '1725089171XplD64vN9OhKFK9klICh9tpvF2rLMSVkXcMZ8J49.png', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, '2024-08-31 01:56:11', '2024-08-31 01:56:11'),
	(7, 4, 'Test franchise shop', 'Test Franchise User', 'test3@uditsolutions.com', '9136248458', 'test address', 'Thakkar Bappa', 'mumbai', 'india', 'Maharashtra', '400071', NULL, NULL, '1725089508e6ZW27JnJKzDe28h0cbY4irQl5cb7xJi4lAUMX0B.png', NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, '2024-08-31 02:01:48', '2024-08-31 02:05:19');

-- Dumping structure for table waffle.items
CREATE TABLE IF NOT EXISTS `items` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `qty` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `items_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `items_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.items: ~3 rows (approximately)
INSERT INTO `items` (`id`, `franchise_id`, `name`, `qty`, `type`, `image`, `created_at`, `updated_at`) VALUES
	(1, 1, 'Casper Schaden', '29', 'hic', NULL, '2024-08-30 04:25:22', '2024-08-30 04:25:22'),
	(2, 7, 'Test Item', '1', 'Package', '1725090838PVJTFYhO4hprcJuUR5JJmgM4a5gPBbJsUnmXvkdg.png', '2024-08-31 02:17:43', '2024-08-31 02:23:58');

-- Dumping structure for table waffle.master_franchises
CREATE TABLE IF NOT EXISTS `master_franchises` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `photo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `master_franchises_email_unique` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.master_franchises: ~2 rows (approximately)
INSERT INTO `master_franchises` (`id`, `name`, `email`, `phone`, `photo`, `created_at`, `updated_at`) VALUES
	(1, 'Heber Bins', 'esperanza31@example.org', '1234567891', '1725019413SYBjSPHuRKkEoafIAHwC9BC600pwnHY9XKVMMe31.png', '2024-08-30 04:25:21', '2024-08-30 06:35:45'),
	(4, 'Test Franchise', 'test@uditsolutions.com', '1234567891', '1725088063Ez2FWbeCmI9hEyx55c4M2EE9TbRfPczkmHyfss9p.png', '2024-08-31 01:35:29', '2024-08-31 01:37:43');

-- Dumping structure for table waffle.migrations
CREATE TABLE IF NOT EXISTS `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.migrations: ~0 rows (approximately)
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
	(1, '0001_01_01_000001_create_cache_table', 1),
	(2, '2024_08_28_121650_create_personal_access_tokens_table', 1),
	(3, '2024_08_29_053828_create_master_franchises_table', 1),
	(4, '2024_08_30_033733_create_franchises_table', 1),
	(5, '2024_08_30_033740_create_users_table', 1),
	(6, '2024_08_30_055736_create_attendances_table', 1),
	(7, '2024_08_30_060046_create_expense_types_table', 1),
	(8, '2024_08_30_060248_create_expenses_table', 1),
	(9, '2024_08_30_060605_create_items_table', 1),
	(10, '2024_08_30_060741_create_order_sources_table', 1),
	(11, '2024_08_30_060917_create_payment_types_table', 1),
	(12, '2024_08_30_061303_create_purchase_orders_table', 1),
	(13, '2024_08_30_061421_create_purchase_order_details_table', 1),
	(14, '2024_08_30_061703_create_recipes_table', 1),
	(15, '2024_08_30_061741_create_recipe_details_table', 1),
	(16, '2024_08_30_062030_create_supports_table', 1),
	(17, '2024_08_30_062231_create_tables_table', 1),
	(18, '2024_08_30_062433_create_tickets_table', 1),
	(19, '2024_08_30_062708_create_ticket_replies_table', 1),
	(20, '2024_08_30_062945_create_bills_table', 1),
	(21, '2024_08_30_063248_create_bill_details_table', 1),
	(22, '2024_08_30_063454_create_parcel_details_table', 1);

-- Dumping structure for table waffle.order_sources
CREATE TABLE IF NOT EXISTS `order_sources` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `order_sources_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `order_sources_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.order_sources: ~0 rows (approximately)

-- Dumping structure for table waffle.parcel_details
CREATE TABLE IF NOT EXISTS `parcel_details` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bill_id` bigint unsigned DEFAULT NULL,
  `item_id` bigint unsigned DEFAULT NULL,
  `qty` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `parcel_details_bill_id_foreign` (`bill_id`),
  KEY `parcel_details_item_id_foreign` (`item_id`),
  CONSTRAINT `parcel_details_bill_id_foreign` FOREIGN KEY (`bill_id`) REFERENCES `bills` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `parcel_details_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.password_reset_tokens: ~0 rows (approximately)

-- Dumping structure for table waffle.payment_types
CREATE TABLE IF NOT EXISTS `payment_types` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `payment_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `payment_types_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `payment_types_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping structure for table waffle.purchase_orders
CREATE TABLE IF NOT EXISTS `purchase_orders` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `vendor_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `date` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `paid_date` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_paid` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_orders_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `purchase_orders_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.purchase_orders: ~0 rows (approximately)

-- Dumping structure for table waffle.purchase_order_details
CREATE TABLE IF NOT EXISTS `purchase_order_details` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `purchase_order_id` bigint unsigned DEFAULT NULL,
  `item_id` bigint unsigned DEFAULT NULL,
  `qty` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `purchase_order_details_purchase_order_id_foreign` (`purchase_order_id`),
  KEY `purchase_order_details_item_id_foreign` (`item_id`),
  CONSTRAINT `purchase_order_details_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `purchase_order_details_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.purchase_order_details: ~0 rows (approximately)

-- Dumping structure for table waffle.recipes
CREATE TABLE IF NOT EXISTS `recipes` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gst` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recipes_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `recipes_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.recipes: ~0 rows (approximately)
INSERT INTO `recipes` (`id`, `franchise_id`, `name`, `price`, `gst`, `image`, `created_at`, `updated_at`) VALUES
	(1, 1, 'Miss Ressie Kunze Jr.', '101', NULL, NULL, '2024-08-30 04:25:22', '2024-08-30 04:25:22');

-- Dumping structure for table waffle.recipe_details
CREATE TABLE IF NOT EXISTS `recipe_details` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `recipe_id` bigint unsigned DEFAULT NULL,
  `item_id` bigint unsigned DEFAULT NULL,
  `qty` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `recipe_details_recipe_id_foreign` (`recipe_id`),
  KEY `recipe_details_item_id_foreign` (`item_id`),
  CONSTRAINT `recipe_details_item_id_foreign` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `recipe_details_recipe_id_foreign` FOREIGN KEY (`recipe_id`) REFERENCES `recipes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.recipe_details: ~0 rows (approximately)
INSERT INTO `recipe_details` (`id`, `recipe_id`, `item_id`, `qty`, `created_at`, `updated_at`) VALUES
	(1, 1, 1, '1', '2024-08-30 04:25:22', '2024-08-30 04:25:22');

-- Dumping structure for table waffle.sessions
CREATE TABLE IF NOT EXISTS `sessions` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.sessions: ~0 rows (approximately)

-- Dumping structure for table waffle.supports
CREATE TABLE IF NOT EXISTS `supports` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `subject` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `remarks` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `supports_user_id_foreign` (`user_id`),
  CONSTRAINT `supports_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.supports: ~0 rows (approximately)

-- Dumping structure for table waffle.tables
CREATE TABLE IF NOT EXISTS `tables` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `master_franchise_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tables_franchise_id_foreign` (`franchise_id`),
  KEY `tables_master_franchise_id_foreign` (`master_franchise_id`),
  CONSTRAINT `tables_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tables_master_franchise_id_foreign` FOREIGN KEY (`master_franchise_id`) REFERENCES `master_franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.tables: ~2 rows (approximately)
INSERT INTO `tables` (`id`, `franchise_id`, `master_franchise_id`, `name`, `status`, `deleted_at`, `created_at`, `updated_at`) VALUES
	(1, 1, 1, 'Providenci Collins', 0, NULL, '2024-08-30 04:25:22', '2024-08-30 04:25:22'),
	(2, 1, 1, 'Dr. Adelbert Heathcote', 0, NULL, '2024-08-30 04:25:22', '2024-08-30 04:25:22'),
	(3, 1, 1, 'Sienna Rodriguez', 0, NULL, '2024-08-30 04:25:22', '2024-08-30 04:25:22');

-- Dumping structure for table waffle.tickets
CREATE TABLE IF NOT EXISTS `tickets` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned DEFAULT NULL,
  `franchise_id` bigint unsigned DEFAULT NULL,
  `subject` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `message` text COLLATE utf8mb4_unicode_ci,
  `file` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `resolved_date` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `remarks` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tickets_user_id_foreign` (`user_id`),
  KEY `tickets_franchise_id_foreign` (`franchise_id`),
  CONSTRAINT `tickets_franchise_id_foreign` FOREIGN KEY (`franchise_id`) REFERENCES `franchises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `tickets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Dumping data for table waffle.tickets: ~0 rows (approximately)

-- Dumping structure for table waffle.ticket_replies
CREATE TABLE IF NOT EXISTS `ticket_replies` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint unsigned NOT NULL,
  `ticket_id` bigint unsigned NOT NULL,
  `reply` text COLLATE utf8mb4_unicode_ci,
  `file` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ticket_replies_user_id_foreign` (`user_id`),
  KEY `ticket_replies_ticket_id_foreign` (`ticket_id`),
  CONSTRAINT `ticket_replies_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ticket_replies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

