ALTER TABLE qna_table ADD COLUMN IF NOT EXISTS created_at BIGINT DEFAULT date_part('epoch',NOW()) * 1e9;

ALTER TABLE qna_version_table ADD COLUMN IF NOT EXISTS created_at BIGINT DEFAULT date_part('epoch',NOW()) * 1e9;

CREATE INDEX IF NOT EXISTS ix_qna_task_id_created_at ON qna_table (task_id, created_at);
CREATE INDEX IF NOT EXISTS ix_qna_version_task_id_created_at ON qna_version_table (task_id, created_at);
