1. create the new table gokwik_shopping_cart CREATE TABLE `gokwik_shopping_cart` ( `id` int(11) NOT NULL, `cart_id` varchar(191) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `product_id` int(11) NOT NULL, `quantity` int(11) NOT NULL DEFAULT 0, `unit_price` float(8,2) NOT NULL DEFAULT 0.00, `amount` float(8,2) NOT NULL DEFAULT 0.00, `status` varchar(25) NOT NULL DEFAULT 'INCART', `created_by` int(11) DEFAULT NULL, `updated_by` int(11) DEFAULT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, `prime_saving` float(8,2) DEFAULT NULL, `mrp` float(8,2) DEFAULT NULL, `original_prime_saving` float(8,2) DEFAULT NULL, `original_unit_price` float(8,2) DEFAULT NULL, `product_coin_offer_campaigns_id` int(11) DEFAULT NULL, `discount_code` varchar(191) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci; ALTER TABLE `gokwik_shopping_cart` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `id` (`id`), ADD KEY `FK_gokwik_shopping_cart` (`user_id`), ADD KEY `FK_products` (`product_id`), ADD KEY `status` (`status`), ADD KEY `user_id_product_id_status` (`user_id`,`product_id`,`status`), ADD KEY `idx_cart_campaign` (`product_coin_offer_campaigns_id`); ALTER TABLE `gokwik_shopping_cart` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; ALTER TABLE `gokwik_shopping_cart` ADD CONSTRAINT `FK_gokwik_shopping_cart` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`); COMMIT; 2.create the new table gokwik_order_items_details CREATE TABLE `gokwik_order_items_details` ( `id` int(11) NOT NULL, `gokwik_order_id` int(11) NOT NULL, `product_id` int(11) NOT NULL, `quantity_list_id` int(11) NOT NULL, `quantity` int(11) NOT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci; ALTER TABLE `gokwik_order_items_details` ADD PRIMARY KEY (`id`), ADD KEY `FK_gokwik_order_items_details` (`gokwik_order_id`); ALTER TABLE `gokwik_order_items_details` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; COMMIT; ALTER TABLE `gokwik_order_items_details` ADD CONSTRAINT `gokwik_order_items_details_ibfk_1` FOREIGN KEY (`gokwik_order_id`) REFERENCES `order` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `gokwik_order_items_details_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE; COMMIT; 3. create the new table gokwik_order CREATE TABLE `gokwik_order` ( `id` int(11) NOT NULL, `order_id` varchar(191) DEFAULT NULL, `user_id` int(11) NOT NULL, `cart_id` varchar(191) DEFAULT NULL, `subscription_id` bigint(20) DEFAULT NULL, `subscriptions_id_json` text DEFAULT NULL, `order_placement_date` date DEFAULT NULL, `delivery_charge` float(8,2) NOT NULL DEFAULT 0.00, `coupon_code` varchar(255) DEFAULT NULL, `discount_amount` float(8,2) NOT NULL DEFAULT 0.00, `delivery_date` date DEFAULT NULL, `delivery_slot` varchar(25) NOT NULL DEFAULT 'Morning', `sub_total` float(8,2) DEFAULT NULL, `net_amount` float(8,2) DEFAULT NULL, `payment_type` varchar(25) DEFAULT 'Prepaid', `bill_id` int(11) DEFAULT NULL, `status` varchar(25) NOT NULL DEFAULT 'PENDING', `created_by` int(11) DEFAULT NULL, `updated_by` int(11) DEFAULT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, `meta_data` text DEFAULT NULL, `coins_redeemed` int(11) DEFAULT 0, `coins_discount_amount` float(8,2) DEFAULT 0.00 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci; ALTER TABLE `gokwik_order` ADD PRIMARY KEY (`id`), ADD KEY `FK_gokwik_order` (`user_id`), ADD KEY `order_placement_date` (`order_placement_date`), ADD KEY `delivery_date` (`delivery_date`), ADD KEY `bill_id` (`bill_id`), ADD KEY `status` (`status`); ALTER TABLE `gokwik_order` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; ALTER TABLE `gokwik_order` ADD CONSTRAINT `FK_gokwik_order` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`); COMMIT; 4. create the new table action_perform CREATE TABLE `action_perform` ( `id` int(11) NOT NULL, `cart_id` varchar(191) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `action` varchar(191) DEFAULT NULL, `phone` varchar(50) DEFAULT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, `last_response` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci; ALTER TABLE `action_perform` ADD PRIMARY KEY (`id`); ALTER TABLE `action_perform` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; COMMIT; 5. create the new table shipping_option CREATE TABLE `shipping_option` ( `id` int(11) NOT NULL, `shipping_key` varchar(1024) NOT NULL, `price` varchar(1024) DEFAULT NULL, `title` varchar(1024) DEFAULT NULL, `currency` varchar(100) DEFAULT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci; ALTER TABLE `shipping_option` ADD PRIMARY KEY (`id`); ALTER TABLE `shipping_option` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; COMMIT;