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

WAITP-1524: Make survey project_id field non-nullable #5312

Merged
merged 5 commits into from
Jan 9, 2024

Conversation

alexd-bes
Copy link
Contributor

Issue WAITP-1524: Make survey project_id field non-nullable

Changes:

  • Add migration to make survey project ID field not nullable

Copy link
Collaborator

@rohan-bes rohan-bes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment about changing the ids in used in the tests.

Looks good, pre-approving 👍

@@ -37,6 +38,15 @@ const buildAndInsertDataGroup = async (models, fields) => {
);
};

const buildAndInsertProject = async models => {
const uniqueId = generateId();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const uniqueId = generateId();
const uniqueId = generateTestId();

It's generally best to use the generateTestId function when working in tests. This is because we rely on a regex of ids containing the string test in order to work out what data to clean up.

Now that we've switched to using the tupaia test database, we really ought to just completely truncate all the data. But until we do that we need to use generateTestId

@alexd-bes alexd-bes merged commit ef44a25 into dev Jan 9, 2024
42 checks passed
@alexd-bes alexd-bes deleted the waitp-1524-survey-project-non-nullable branch January 9, 2024 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants