ALTER TABLE ponno_purchase_entries
ADD COLUMN mohajon_owner_setup_id BIGINT UNSIGNED NULL AFTER mohajon_setup_id,
ADD CONSTRAINT ponno_purchase_entries_mohajon_owner_setup_id_foreign 
FOREIGN KEY (mohajon_owner_setup_id) REFERENCES mohajon_owner_setups(id);

-- users add

ALTER TABLE bank_entries
ADD COLUMN user_id BIGINT UNSIGNED NULL AFTER id, 
ADD CONSTRAINT bank_entries_user_id_foreign  
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE mohajon_payment_entries
ADD COLUMN user_id BIGINT UNSIGNED NULL AFTER id, 
ADD CONSTRAINT mohajon_payment_entries_user_id_foreign  
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE mohajon_return_entries
ADD COLUMN user_id BIGINT UNSIGNED NULL AFTER id, 
ADD CONSTRAINT mohajon_return_entries_user_id_foreign  
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE amanot_entries
ADD COLUMN user_id BIGINT UNSIGNED NULL AFTER id, 
ADD CONSTRAINT amanot_entries_user_id_foreign  
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE hawlat_entries
ADD COLUMN user_id BIGINT UNSIGNED NULL AFTER id, 
ADD CONSTRAINT hawlat_entries_user_id_foreign  
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE other_joma_khoroc_entries
ADD COLUMN user_id BIGINT UNSIGNED NULL AFTER id, 
ADD CONSTRAINT other_joma_khoroc_entries_user_id_foreign  
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE kreta_koifiyot_entries
ADD COLUMN user_id BIGINT UNSIGNED NULL AFTER id, 
ADD CONSTRAINT kreta_koifiyot_entries_user_id_foreign  
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE ponno_purchase_entries
ADD COLUMN user_id BIGINT UNSIGNED NULL AFTER id, 
ADD CONSTRAINT ponno_purchase_entries_user_id_foreign  
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE ponno_sales_infos
ADD COLUMN user_id BIGINT UNSIGNED NULL AFTER id, 
ADD CONSTRAINT ponno_sales_infos_user_id_foreign  
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE mohajon_koifiyot_entries
ADD COLUMN user_id BIGINT UNSIGNED NULL AFTER id, 
ADD CONSTRAINT mohajon_koifiyot_entries_user_id_foreign  
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE protistan_khoroc_entries
ADD COLUMN user_id BIGINT UNSIGNED NULL AFTER id, 
ADD CONSTRAINT protistan_khoroc_entries_user_id_foreign  
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE stock_transfers
ADD COLUMN user_id BIGINT UNSIGNED NULL AFTER id, 
ADD CONSTRAINT stock_transfers_user_id_foreign  
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE arod_chotha_infos
ADD COLUMN user_id BIGINT UNSIGNED NULL AFTER id, 
ADD CONSTRAINT arod_chotha_infos_user_id_foreign  
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE kreta_joma_entries
ADD COLUMN user_id BIGINT UNSIGNED NULL AFTER id, 
ADD CONSTRAINT kreta_joma_entries_user_id_foreign  
FOREIGN KEY (user_id) REFERENCES users(id);

ALTER TABLE ponno_purchase_cost_entries
ADD COLUMN user_id BIGINT UNSIGNED NULL AFTER id, 
ADD CONSTRAINT ponno_purchase_cost_entries_user_id_foreign  
FOREIGN KEY (user_id) REFERENCES users(id);

-- add stock id in temp sale

ALTER TABLE temp_ponno_sales
ADD COLUMN stock_id BIGINT UNSIGNED NOT NULL AFTER purchase_id, 
ADD CONSTRAINT temp_ponno_sales_stock_id_foreign  
FOREIGN KEY (stock_id) REFERENCES stocks(id);


ALTER TABLE `stock_transfers`
ADD COLUMN `entry_date` DATE NULL AFTER `description`;

ALTER TABLE reminders
ADD COLUMN status INT DEFAULT 1 COMMENT '0 = Inactive & 1 = Active' AFTER `date_to`;
