Databases: Violation of unique key constraint that doesn't seem to exist