fix PG::Error: duplicate key value violates unique constraint "idx_uniqu...

...e_rows"

details [issue #344](https://github.com/discourse/discourse/issues/344)