Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change cloud person username fields to be not null #860

Conversation

eiffel777
Copy link
Contributor

In PR #797 the Person and System Account group bys were added to the Cloud realm. In that PR the person_id field was added to the staging tables with a default of NULL and was added to the Primary Key on that table. This caused the error below on the xdmod-dev database.

xdmod.jobs-cloud-extract-openstack.OpenStackCloudStagingEventIngestor (ETL\Ingestor\DatabaseIngestor): 
Error managing ETL table for 'xdmod.jobs-cloud-extract-openstack.OpenStackCloudStagingEventIngestor': 
SQLSTATE[42000]: Syntax error or access violation: 1171 All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead

This error doesn't show up on metrics-dev or in the my docker but does on xdmod-dev and it seems to be because metrics-dev and my docker run MySQL 5.5 and xdmod-dev runs MySQL 5.7. It seems MySQL is stricter about errors in 5.7.

Changing the person_id definition to NOT NULL with a default of -1 fixes this.

Tests performed

Manually tested in docker and on xdmod-dev. All tests pass

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project as found in the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@eiffel777 eiffel777 added bug Bugfixes Category:Cloud Cloud Realm labels Mar 15, 2019
@eiffel777 eiffel777 added this to the 8.1.0 milestone Mar 15, 2019
@eiffel777 eiffel777 self-assigned this Mar 15, 2019
@eiffel777 eiffel777 requested review from plessbd and smgallo March 15, 2019 15:20
@eiffel777 eiffel777 merged commit 90a42f7 into ubccr:xdmod8.1 Mar 15, 2019
@plessbd plessbd modified the milestone: 8.1.0 Mar 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugfixes Category:Cloud Cloud Realm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants