DROP USER IF EXISTS 'engine_read'@'localhost';
DROP USER IF EXISTS 'engine_read'@'10.0.1.%';
DROP USER IF EXISTS 'engine_read'@'::1';
CREATE USER 'engine_read'@'localhost' IDENTIFIED BY '{{ENGINE_READ_PASSWORD}}';
CREATE USER 'engine_read'@'10.0.1.%' IDENTIFIED BY '{{ENGINE_READ_PASSWORD}}';
CREATE USER 'engine_read'@'::1' IDENTIFIED BY '{{ENGINE_READ_PASSWORD}}';
GRANT SELECT ON engine.artifacts TO 'engine_read'@'localhost';
GRANT SELECT ON engine.payments TO 'engine_read'@'localhost';
GRANT SELECT ON engine.payment_methods TO 'engine_read'@'localhost';
GRANT SELECT ON engine.email_queue TO 'engine_read'@'localhost';
GRANT SELECT ON engine.fulfillment TO 'engine_read'@'localhost';
GRANT SELECT ON engine.canada_post_tracking TO 'engine_read'@'localhost';
GRANT SELECT ON engine.sessions TO 'engine_read'@'localhost';
GRANT SELECT ON engine.strikes TO 'engine_read'@'localhost';
GRANT SELECT ON engine.ip_reputation TO 'engine_read'@'localhost';
GRANT SELECT ON engine.node_health TO 'engine_read'@'localhost';
GRANT SELECT ON engine.logs TO 'engine_read'@'localhost';
GRANT SELECT ON engine.security_events TO 'engine_read'@'localhost';
GRANT SELECT ON engine.waf_rules TO 'engine_read'@'localhost';
GRANT SELECT ON engine.ai_inferences TO 'engine_read'@'localhost';
GRANT SELECT ON engine.file_integrity TO 'engine_read'@'localhost';
GRANT SELECT ON engine.unified_orders TO 'engine_read'@'localhost';
GRANT SELECT ON engine.unified_customers TO 'engine_read'@'localhost';
GRANT SELECT ON engine.unified_inventory TO 'engine_read'@'localhost';
GRANT SELECT ON engine.unified_transactions TO 'engine_read'@'localhost';
GRANT SELECT ON engine.unified_audit_log TO 'engine_read'@'localhost';
GRANT SELECT ON engine.node_store_map TO 'engine_read'@'localhost';
GRANT SELECT ON engine.sync_queue TO 'engine_read'@'localhost';
GRANT SELECT ON engine.unified_notifications TO 'engine_read'@'localhost';
GRANT SELECT ON store.* TO 'engine_read'@'localhost';
GRANT SELECT ON engine.artifacts TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.payments TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.payment_methods TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.email_queue TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.fulfillment TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.canada_post_tracking TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.sessions TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.strikes TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.ip_reputation TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.node_health TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.logs TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.security_events TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.waf_rules TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.ai_inferences TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.file_integrity TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.unified_orders TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.unified_customers TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.unified_inventory TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.unified_transactions TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.unified_audit_log TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.node_store_map TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.sync_queue TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.unified_notifications TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON store.* TO 'engine_read'@'10.0.1.%';
GRANT SELECT ON engine.artifacts TO 'engine_read'@'::1';
GRANT SELECT ON engine.payments TO 'engine_read'@'::1';
GRANT SELECT ON engine.payment_methods TO 'engine_read'@'::1';
GRANT SELECT ON engine.email_queue TO 'engine_read'@'::1';
GRANT SELECT ON engine.fulfillment TO 'engine_read'@'::1';
GRANT SELECT ON engine.canada_post_tracking TO 'engine_read'@'::1';
GRANT SELECT ON engine.sessions TO 'engine_read'@'::1';
GRANT SELECT ON engine.strikes TO 'engine_read'@'::1';
GRANT SELECT ON engine.ip_reputation TO 'engine_read'@'::1';
GRANT SELECT ON engine.node_health TO 'engine_read'@'::1';
GRANT SELECT ON engine.logs TO 'engine_read'@'::1';
GRANT SELECT ON engine.security_events TO 'engine_read'@'::1';
GRANT SELECT ON engine.waf_rules TO 'engine_read'@'::1';
GRANT SELECT ON engine.ai_inferences TO 'engine_read'@'::1';
GRANT SELECT ON engine.file_integrity TO 'engine_read'@'::1';
GRANT SELECT ON engine.unified_orders TO 'engine_read'@'::1';
GRANT SELECT ON engine.unified_customers TO 'engine_read'@'::1';
GRANT SELECT ON engine.unified_inventory TO 'engine_read'@'::1';
GRANT SELECT ON engine.unified_transactions TO 'engine_read'@'::1';
GRANT SELECT ON engine.unified_audit_log TO 'engine_read'@'::1';
GRANT SELECT ON engine.node_store_map TO 'engine_read'@'::1';
GRANT SELECT ON engine.sync_queue TO 'engine_read'@'::1';
GRANT SELECT ON engine.unified_notifications TO 'engine_read'@'::1';
GRANT SELECT ON store.* TO 'engine_read'@'::1';
DROP USER IF EXISTS 'engine_write'@'localhost';
DROP USER IF EXISTS 'engine_write'@'10.0.1.%';
DROP USER IF EXISTS 'engine_write'@'::1';
CREATE USER 'engine_write'@'localhost' IDENTIFIED BY '{{ENGINE_WRITE_PASSWORD}}';
CREATE USER 'engine_write'@'10.0.1.%' IDENTIFIED BY '{{ENGINE_WRITE_PASSWORD}}';
CREATE USER 'engine_write'@'::1' IDENTIFIED BY '{{ENGINE_WRITE_PASSWORD}}';
GRANT SELECT, INSERT, UPDATE ON engine.artifacts TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.payments TO 'engine_write'@'localhost';
GRANT SELECT, INSERT ON engine.payment_methods TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.email_queue TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.fulfillment TO 'engine_write'@'localhost';
GRANT SELECT, INSERT ON engine.canada_post_tracking TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.sessions TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.strikes TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.ip_reputation TO 'engine_write'@'localhost';
GRANT SELECT, INSERT ON engine.node_health TO 'engine_write'@'localhost';
GRANT SELECT, INSERT ON engine.logs TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.security_events TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.waf_rules TO 'engine_write'@'localhost';
GRANT SELECT, INSERT ON engine.ai_inferences TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.file_integrity TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.unified_orders TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.unified_customers TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.unified_inventory TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.unified_transactions TO 'engine_write'@'localhost';
GRANT SELECT, INSERT ON engine.unified_audit_log TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.node_store_map TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.sync_queue TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.unified_notifications TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON store.* TO 'engine_write'@'localhost';
GRANT SELECT, INSERT, UPDATE ON engine.artifacts TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.payments TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT ON engine.payment_methods TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.email_queue TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.fulfillment TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT ON engine.canada_post_tracking TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.sessions TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.strikes TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.ip_reputation TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT ON engine.node_health TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT ON engine.logs TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.security_events TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.waf_rules TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT ON engine.ai_inferences TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.file_integrity TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.unified_orders TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.unified_customers TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.unified_inventory TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.unified_transactions TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT ON engine.unified_audit_log TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.node_store_map TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.sync_queue TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.unified_notifications TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON store.* TO 'engine_write'@'10.0.1.%';
GRANT SELECT, INSERT, UPDATE ON engine.artifacts TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.payments TO 'engine_write'@'::1';
GRANT SELECT, INSERT ON engine.payment_methods TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.email_queue TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.fulfillment TO 'engine_write'@'::1';
GRANT SELECT, INSERT ON engine.canada_post_tracking TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.sessions TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.strikes TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.ip_reputation TO 'engine_write'@'::1';
GRANT SELECT, INSERT ON engine.node_health TO 'engine_write'@'::1';
GRANT SELECT, INSERT ON engine.logs TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.security_events TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.waf_rules TO 'engine_write'@'::1';
GRANT SELECT, INSERT ON engine.ai_inferences TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.file_integrity TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.unified_orders TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.unified_customers TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.unified_inventory TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.unified_transactions TO 'engine_write'@'::1';
GRANT SELECT, INSERT ON engine.unified_audit_log TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.node_store_map TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.sync_queue TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON engine.unified_notifications TO 'engine_write'@'::1';
GRANT SELECT, INSERT, UPDATE ON store.* TO 'engine_write'@'::1';
GRANT EXECUTE ON PROCEDURE engine.sp_process_payment TO 'engine_write'@'localhost';
GRANT EXECUTE ON PROCEDURE engine.sp_send_email TO 'engine_write'@'localhost';
GRANT EXECUTE ON PROCEDURE engine.sp_start_fulfillment TO 'engine_write'@'localhost';
GRANT EXECUTE ON PROCEDURE engine.sp_update_trust_score TO 'engine_write'@'localhost';
GRANT EXECUTE ON PROCEDURE engine.sp_add_strike TO 'engine_write'@'localhost';
GRANT EXECUTE ON PROCEDURE engine.sp_check_session TO 'engine_write'@'localhost';
GRANT EXECUTE ON PROCEDURE engine.sp_process_canada_post_webhook TO 'engine_write'@'localhost';
GRANT EXECUTE ON PROCEDURE engine.sp_process_payment TO 'engine_write'@'10.0.1.%';
GRANT EXECUTE ON PROCEDURE engine.sp_send_email TO 'engine_write'@'10.0.1.%';
GRANT EXECUTE ON PROCEDURE engine.sp_start_fulfillment TO 'engine_write'@'10.0.1.%';
GRANT EXECUTE ON PROCEDURE engine.sp_update_trust_score TO 'engine_write'@'10.0.1.%';
GRANT EXECUTE ON PROCEDURE engine.sp_add_strike TO 'engine_write'@'10.0.1.%';
GRANT EXECUTE ON PROCEDURE engine.sp_check_session TO 'engine_write'@'10.0.1.%';
GRANT EXECUTE ON PROCEDURE engine.sp_process_canada_post_webhook TO 'engine_write'@'10.0.1.%';
GRANT EXECUTE ON PROCEDURE engine.sp_process_payment TO 'engine_write'@'::1';
GRANT EXECUTE ON PROCEDURE engine.sp_send_email TO 'engine_write'@'::1';
GRANT EXECUTE ON PROCEDURE engine.sp_start_fulfillment TO 'engine_write'@'::1';
GRANT EXECUTE ON PROCEDURE engine.sp_update_trust_score TO 'engine_write'@'::1';
GRANT EXECUTE ON PROCEDURE engine.sp_add_strike TO 'engine_write'@'::1';
GRANT EXECUTE ON PROCEDURE engine.sp_check_session TO 'engine_write'@'::1';
GRANT EXECUTE ON PROCEDURE engine.sp_process_canada_post_webhook TO 'engine_write'@'::1';
DROP USER IF EXISTS 'engine_admin'@'localhost';
DROP USER IF EXISTS 'engine_admin'@'10.0.1.6';
CREATE USER 'engine_admin'@'localhost' IDENTIFIED BY '{{ENGINE_ADMIN_PASSWORD}}';
CREATE USER 'engine_admin'@'10.0.1.6' IDENTIFIED BY '{{ENGINE_ADMIN_PASSWORD}}';
GRANT ALL PRIVILEGES ON engine.* TO 'engine_admin'@'localhost';
GRANT ALL PRIVILEGES ON engine.* TO 'engine_admin'@'10.0.1.6';
GRANT ALL PRIVILEGES ON store.* TO 'engine_admin'@'localhost';
GRANT ALL PRIVILEGES ON store.* TO 'engine_admin'@'10.0.1.6';
GRANT CREATE, DROP, RELOAD, PROCESS, FILE, SUPER, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'engine_admin'@'localhost';
GRANT CREATE, DROP, RELOAD, PROCESS, FILE, SUPER, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'engine_admin'@'10.0.1.6';
GRANT EVENT ON engine.* TO 'engine_admin'@'localhost';
GRANT EVENT ON engine.* TO 'engine_admin'@'10.0.1.6';
GRANT TRIGGER ON engine.* TO 'engine_admin'@'localhost';
GRANT TRIGGER ON engine.* TO 'engine_admin'@'10.0.1.6';
FLUSH PRIVILEGES;