Add history table and repository