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 4689 database migration #3662

Open
wants to merge 2 commits into
base: integration
Choose a base branch
from

Conversation

Duncan-Brain
Copy link
Collaborator

@Duncan-Brain Duncan-Brain commented Jan 23, 2025

Description

Migrates existing "integration" table to new construct of "addon". Did not drop or edit any sensors tables at all.

This adds a few extra renames than discussed:

  • renamed integrating_partner -> addon
  • our new standard seems to be not referencing the table name in the column names - updated those in addon
  • org_id kept as org_uuid since the column is of that type and is more clear - maybe we will generalise in the future as we get more intgrations.

Jira link: LF-4689

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?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Passes test case
  • UI components visually reviewed on desktop view
  • UI components visually reviewed on mobile view
  • Other (please explain): ran the migration up and down, run tests

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

@Duncan-Brain Duncan-Brain requested review from a team as code owners January 23, 2025 16:24
@Duncan-Brain Duncan-Brain requested review from antsgar and kathyavini and removed request for a team January 23, 2025 16:24
*/

export const up = async function (knex) {
await knex.schema.renameTable('integrating_partner', 'addon');
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@antsgar would you like this to be addon_partner instead ? and then also farm_addon_partner for the other table and .. addon_partner_id etc?

I think my preference is shorter table name but just tell me if I should change it.

Copy link
Collaborator

@kathyavini kathyavini Jan 24, 2025

Choose a reason for hiding this comment

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

Hmmm. I actually don't see integrating_partner and addon_partner as equivalent (i.e. I would think addons can refer to integrating_partners or not, and not all integrating partners need to have a corresponding addon. So my vote is for the table names as they were given in the ticket (no changes at all to integrating_partner). But I acknowledge it's not a very consistent preference!

But yeah, the more I look at

t.renameColumn('partner_id', 'addon_id');

the more that doesn't sit right for me 😂 The id is a reference to Ensemble. Only in the context of a farm's settings does it become an addon.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@kathyavini So when we have a dropdown for the user with "addon options" that should instead be "integrating partner options" in the UI? Open to whatever but farm_external_integration and integrating_partner seemed centered around the the 'integration' concept which in the LiteFarm domain we are now calling 'addon'. Thats how I got here, and it sounded like Anto thought that made sense haha

But external_api_credentials or addon_partner(integrating partner) and addon(farm_addon) also make sense to me as represesntative of the table columns. I am really good with whatever -- I just made it before looking too much. @antsgar knowing what has been discussed you want to just choose your preferred?

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