ALTER TABLE qna_table ADD COLUMN IF NOT EXISTS last_assigned_rater TEXT;
ALTER TABLE qna_table ADD COLUMN IF NOT EXISTS last_assigned_manager TEXT;
ALTER TABLE qna_table ADD COLUMN IF NOT EXISTS last_answered_ds TEXT;

CREATE INDEX IF NOT EXISTS ix_qna_task_state_deleted_rater_ds_manager ON qna_table (task_id, state_id, deleted, last_assigned_rater, last_answered_ds, last_assigned_manager);

ALTER TABLE qna_version_table ADD COLUMN IF NOT EXISTS last_assigned_rater TEXT;
ALTER TABLE qna_version_table ADD COLUMN IF NOT EXISTS last_assigned_manager TEXT;
ALTER TABLE qna_version_table ADD COLUMN IF NOT EXISTS last_answered_ds TEXT;
