Skip to content

Conversation

tolot27
Copy link

@tolot27 tolot27 commented Oct 5, 2025

The migrate commend does not migrate meters yet. This PR addresses this gap and fixes the meter references in the circuits as well.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@tolot27
Copy link
Author

tolot27 commented Oct 5, 2025

Is the usage attribute still necessary in the database json string stored in the value column?

@andig andig changed the title Migrate meters cli/migrate: migrate meters Oct 5, 2025
@andig andig added the enhancement New feature or request label Oct 5, 2025
@github-actions github-actions bot added the stale Outdated and ready to close label Oct 12, 2025
@naltatis
Copy link
Member

@tolot27 thanks for your PR!

This is a quite complex migration and it still does not handle all necessary reference update scenarios we can have. Right now we also don't have a loadpoints migration for similar reasons. Loadpoints also can contain references to vehicles, chargers, meters and circuits.

I'd say we don't invest any extra time into the migrate command and deprecate/remove it in on of the next releases. The reset already exists in config ui (config & restore).

We might revisit this decision depending on feedback. For most users it's one (or two) hand full of forms that would have to be filled out manually.

\cc @andig

@naltatis naltatis closed this Oct 14, 2025
@tolot27
Copy link
Author

tolot27 commented Oct 14, 2025

I've added the migration of vehicles, circuits and loadpoints including all reference updates. Just have to push it.
During the development, I've discovered some missing implementation/inconsistencies in the usage of database config, i. e. if/how titles are used, where circuits are stored (still in settings and not config), etc. I'll document it with the push and I leave it to you how to deal with this PR/information.
For me it was very helpful to understand the parts of the code (for further development) and the migration of my infrastructure (27 loadpoints/chargers). It is/was indeed a single event of migration but since I'm lazy I wrote the code instead of doing thousands of clicks in the GUI. 😏
I recommend to either remove the incomplete migrate command (or at least mark it as deprecate/incomplete and document its limitations) or enhance it.

@naltatis
Copy link
Member

I'll document it with the push and I leave it to you how to deal with this PR/information.

Thanks 🙌

@tolot27
Copy link
Author

tolot27 commented Oct 15, 2025

@naltatis, could you please reopen this PR so that it shows the most recent commits from my branch tolot27:migrate_meters?
After that, I will add the above-mentioned comments to the PR. Once that's done, everything will be documented, after which you can either close the PR or merge it. It's up to you.

@andig
Copy link
Member

andig commented Oct 15, 2025

Unfortunately not possible, GH won't let us. Could you create new PR from your branch?

@naltatis
Copy link
Member

Bildschirmfoto 2025-10-15 um 11 02 45

@tolot27
Copy link
Author

tolot27 commented Oct 15, 2025

Unfortunately not possible, GH won't let us. Could you create new PR from your branch?

I've created a new PR #24436.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request stale Outdated and ready to close

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants