

-- add item_pic column to items table
ALTER TABLE `ospos_items` 
   ADD COLUMN `item_pic` int(10) DEFAULT NULL;

ALTER TABLE `ospos_people` 
   ADD COLUMN `gender` int(1) DEFAULT NULL;
   
-- drop redundant payment_type column in sales, add index to sale_time to speed up sorting
ALTER TABLE `ospos_sales`
    DROP COLUMN `payment_type`,
    ADD INDEX `sale_time` (`sale_time`);
   
ALTER TABLE `ospos_customers`
    ADD COLUMN `company_name` varchar(255) DEFAULT NULL;

ALTER TABLE `ospos_giftcards`
    MODIFY `person_id` int(10) DEFAULT NULL;

INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES
('sales_stock', 1),
('receivings_stock', 1);

ALTER TABLE `ospos_receivings_items`
    ADD COLUMN `receiving_quantity` int(11) NOT NULL DEFAULT '1';
