-- Create vehicle_trip_points table
CREATE TABLE vehicle_trip_points (
  id SERIAL PRIMARY KEY,
  trip_id INTEGER NOT NULL,
  latitude DECIMAL(10,6) NOT NULL,
  longitude DECIMAL(10,6) NOT NULL,
  recorded_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  tenant_id INTEGER DEFAULT NULL,
  branch_id INTEGER DEFAULT NULL,
  isDeleted BOOLEAN NOT NULL DEFAULT FALSE,
  updatedAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX vehicle_trip_points_trip_idx ON vehicle_trip_points (trip_id);
CREATE INDEX vehicle_trip_points_tenant_idx ON vehicle_trip_points (tenant_id);
CREATE INDEX vehicle_trip_points_branch_idx ON vehicle_trip_points (branch_id);
