Quote:
Originally Posted by GP2
It is mathematically impossible for two Mersenne numbers with prime exponents to share the same factor, so this would be the easiest way to prevent the problem from recurring.

Of course, it is not impossible (as far as we know) for a Mersenne number with prime exponent to have the same factor twice. However, finding any such nonsquarefree Mersenne number would generate headlines worldwide, because then we'd automatically have the third known Wieferich prime. The odds of this are surely astronomically low.
It's simple enough to test for nonsquarefreeness separately, over the entire database of factors, or at the time any factor is submitted, using standard modular exponentiation library functions, so this unlikely eventuality isn't a reason not to put a unique constraint or unique index on the factors column.