title: How to Model Table to run query's based on status field which is changing over time
body: <p>Currently we have a table which we query using shipment_id and in future we have a need to query based on status field
  Current Table : </p>
  
  <pre><code>CREATE TABLE shipment ( 
      shipment_id text,
      tenant_id text,
      actual_arrival_time text,
      actual_dep_time text,
      email_ids set,
      is_deleted boolean,
      modified_by text,
      modified_time timestamp,
      planned_arrival_time text,
      planned_dep_time text,
      route_id text,
      shipment_departure_date text,
      status_code text,
      PRIMARY KEY (shipment_id, tenant_id) 
  ); 
  
  CREATE INDEX shipment_id_index ON shipment (tenant_id);
  </code></pre>
  
  <p>Current Query's</p>
  
  <p>1) SELECT * FROM shipment where tenant_id=?0 ALLOW FILTERING ;</p>
  
  <p>2) SELECT * FROM shipment WHERE shipment_id=?0 and tenant_id=?1 ;</p>
  
  <p>Pending/Future Query's </p>
  
  <p>list of shipment id's for given status code as of now 
  3) SELECT * FROM shipment WHERE tenant_id = 'y' and status_code  = x ?  ;</p>
  
  <p>4) list of shipment id's for given status code for last 1 week </p>
  
  <p>5) list of shipment id's for which got delayed </p>
  
  <p>Above table There could be 10-15 unique tenants
   and will have 1 shipment_id,1 tenant_id 1 row per table 
  and status_code will be changing over the time as shipment progresses , from Shipment_started, shipment_progress, shipment_delayed, shipment_delayed_completed and shipment_completed etc 
  each shipment in its life time will go through 3-5 statuses , the current table
  will be updated only when there is a status change for a given shipment_id  .</p>
  
  <p>I need to create a new table which can address query's something like below </p>
  
  <p>3) list of shipment's for a given tenant which have status_code = 'x' as of now </p>
  
  <p>4) list of shipment's for a given tenant which have status_code = 'x' for last 1 week </p>
  
  <p>5) list of shipment's for which got delayed ?</p>