-- $Id: wfwl_reports_addcol 503 2012-12-09 01:48:29Z bhockney $
--
-- Add last_accessed and last_saved to table reports
--
ALTER TABLE $WFWL_SCHEMA.reports ADD COLUMN last_accessed bigint;
ALTER TABLE $WFWL_SCHEMA.reports ADD COLUMN last_saved bigint;
ALTER TABLE $WFWL_SCHEMA.reports ALTER COLUMN last_accessed SET DEFAULT 0;
ALTER TABLE $WFWL_SCHEMA.reports ALTER COLUMN last_saved SET DEFAULT 0;
UPDATE $WFWL_SCHEMA.reports SET last_accessed=0 where last_accessed IS NULL;
UPDATE $WFWL_SCHEMA.reports SET last_saved=0 where last_saved IS NULL;
ALTER TABLE $WFWL_SCHEMA.reports ALTER COLUMN last_accessed SET NOT NULL;
ALTER TABLE $WFWL_SCHEMA.reports ALTER COLUMN last_saved SET NOT NULL;
