
/*
* Fechas modificadas para que se puedan hacer query en base a la zona horaria objetivo
* SELECT col_date at time zone 'cet'  -- devuleve la fecha en esa zona
* SELECT col_date                     -- devuleve la fecha en UTC con el offset de la zona horaria
* 
* */

ALTER TABLE objenious_operation
  ALTER COLUMN start_date SET DATA TYPE TIMESTAMP WITH TIME ZONE,
  ALTER COLUMN start_date SET DEFAULT now(),
  ALTER COLUMN last_change_date SET DATA TYPE TIMESTAMP WITH TIME ZONE,
  ALTER COLUMN last_change_date SET DEFAULT now(),
  ALTER COLUMN end_date SET DATA TYPE TIMESTAMP WITH TIME ZONE;

ALTER TABLE objenious_operation_change
  ALTER COLUMN creation_date SET DATA TYPE TIMESTAMP WITH TIME ZONE,
  ALTER COLUMN creation_date SET DEFAULT now();

ALTER TABLE order_tracking
  ALTER COLUMN start_date SET DATA TYPE TIMESTAMP WITH TIME ZONE,
  ALTER COLUMN start_date SET DEFAULT now(),
  ALTER COLUMN update_date SET DATA TYPE TIMESTAMP WITH TIME ZONE,
  ALTER COLUMN update_date SET DEFAULT now(),
  ALTER COLUMN finish_date SET DATA TYPE TIMESTAMP WITH TIME ZONE;

ALTER TABLE order_history
  ALTER COLUMN change_date SET DATA TYPE TIMESTAMP WITH TIME ZONE,
  ALTER COLUMN change_date SET DEFAULT now();
  
