Fix double addition of PRIMARY KEY index in SQL