added a 11th processing to add public key constraint on gid column, when necessary