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

LF-3651 Revenue type table unique violation error on auto-incrementing primary key #2882

Conversation

kathyavini
Copy link
Collaborator

@kathyavini kathyavini commented Sep 20, 2023

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

  • 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 not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Passes test case
  • UI components visually reviewed on desktop view
  • UI components visually reviewed on mobile view
  • Other (please explain)

Was written and tested on local database with all authors @Duncan-Brain and @SayakaOno and @kathyavini

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The precommit and linting ran successfully
  • I have added or updated language tags for text that's part of the UI
  • I have added "MISSING" for all new language tags to languages I don't speak
  • I have added the GNU General Public License to all new files

Co-authored-by: Sayaka Ono <sayaka.ono.81@gmail.com>
Co-authored-by: Duncan Brain <dbrain@litefarm.org>
@kathyavini kathyavini self-assigned this Sep 20, 2023
@kathyavini kathyavini added the bug Something isn't working label Sep 20, 2023
Copy link
Collaborator

@SayakaOno SayakaOno left a comment

Choose a reason for hiding this comment

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

It worked for me!

@kathyavini kathyavini merged commit 534eb74 into integration Sep 20, 2023
1 check passed
@kathyavini kathyavini deleted the LF-3651-revenue-type-table-unique-violation-error-on-auto-incrementing-primary-key branch September 20, 2023 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants