LF-3651 Revenue type table unique violation error on auto-incrementing primary key #2882
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This fixes the database error seen on first insert(s) into the new
revenue_type
table due to the auto-incrementing primary key which was ignored in favour of setting the key explicitly in the migration.This PR amends the migration file. Affected databases (beta, developer local environments) should be rolled back to before when this migration was run (likely 1 or two 2 batches -- please see your own database's
knex_migrations
table) and then run again once this PR is merged. You will lose your existing custom revenue types (on beta none exist yet as the API to create them has not been merged).Jira link: https://lite-farm.atlassian.net/browse/LF-3651
Type of change
How Has This Been Tested?
Was written and tested on local database with all authors @Duncan-Brain and @SayakaOno and @kathyavini
Checklist: