Make mysql idempotent