fix bug where newly added tables were not being added in "replace" mode

http://manage.dimagi.com/default.asp?116123
Merge pull request #3756 from dimagi/case-116123

fix bug where newly added tables were not being added in "replace" mode