-- Run once to add rider GPS columns to users table
-- and delivery coordinates to orders table

ALTER TABLE users
    ADD COLUMN IF NOT EXISTS current_lat   DECIMAL(10,7) DEFAULT NULL,
    ADD COLUMN IF NOT EXISTS current_lng   DECIMAL(10,7) DEFAULT NULL,
    ADD COLUMN IF NOT EXISTS location_at   DATETIME      DEFAULT NULL;

ALTER TABLE orders
    ADD COLUMN IF NOT EXISTS delivery_lat  DECIMAL(10,7) DEFAULT NULL,
    ADD COLUMN IF NOT EXISTS delivery_lng  DECIMAL(10,7) DEFAULT NULL;
