ALTER TABLE businesses
DROP FOREIGN KEY businesses_business_owner_id_foreign;

ALTER TABLE businesses
MODIFY business_owner_id BIGINT UNSIGNED NULL;

ALTER TABLE businesses
ADD CONSTRAINT businesses_business_owner_id_foreign
FOREIGN KEY (business_owner_id) REFERENCES business_owners(id)
ON DELETE SET NULL;


ALTER TABLE businesses
DROP FOREIGN KEY businesses_category_id_foreign;

ALTER TABLE businesses
MODIFY category_id BIGINT UNSIGNED NULL;

ALTER TABLE businesses
ADD CONSTRAINT businesses_category_id_foreign
FOREIGN KEY (category_id) REFERENCES categories(id)
ON DELETE SET NULL;


UPDATE `settings` SET `value`='{\"actions\":{\"owners_registration\":1,\"owners_email_verification\":0,\"owners_kyc_required\":1,\"convert_logo_to_webp\":1,\"reviews_require_login\":1,\"reviews_require_reviewing\":0},\"default\":{\"businesses\":\"2\",\"employees\":1,\"categories\":1},\"media\":{\"default_logo\":\"images\\/businesses\\/default-logo.webp\"},\"trending_number\":\"20\",\"best_rating_number\":\"20\"}' where `key`='business';

UPDATE `settings` SET `value`='{\"actions\":{\"registration\":1,\"email_verification\":0,\"kyc_required\":0,\"adding_none_exists_business\":1}}' where `key`='user';
