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

Handling migrations in Piwik #6640

Closed
mgazdzik opened this issue Nov 11, 2014 · 6 comments
Closed

Handling migrations in Piwik #6640

mgazdzik opened this issue Nov 11, 2014 · 6 comments
Labels
c: Usability For issues that let users achieve a defined goal more effectively or efficiently. duplicate For issues that already existed in our issue tracker and were reported previously. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@mgazdzik
Copy link
Contributor

Currently migrations are carried out by running core:update command.
However it maybe should also be possible to split updates into two flows. One should be db migration and other would be to perform some additional logic.

Possible use case:

  • Piwik admin wants to update his instance with separate DB server,
  • does --dry-run (or simply run core:update as in next versions --dry-run will be deprecated) to see what queries need to be executed
  • executes queries manually on database
  • wants to perform other logic done 'under the hood' (i.e. plugins name change, plugin activation etc) - but currently this is impossible, as Piwik update will notice core_version in piwik_option table set to latest possible, and will omit all the logic that hasn't been executed.

It could come quite in handy when some users have setup, on which running core:update will not be a good idea.

Goal of this ticket is to start discussion about possible improvements and separating DB migrations from additional logic done between some versions.

@tsteur
Copy link
Member

tsteur commented Nov 11, 2014

refs #5985

@mattab mattab added this to the Short term milestone Dec 1, 2014
@mattab mattab added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. c: Usability For issues that let users achieve a defined goal more effectively or efficiently. labels Dec 1, 2014
@mattab
Copy link
Member

mattab commented Dec 1, 2014

Hi @mgazdzik Updater dry-run: do not show the SQL query to update core_version or $plugin_version was fixed in #6760

I think this change should help as a start.

Another good idea could be:

  • Remember which SQL query was executed and do not execute it again

@mattab mattab modified the milestones: Mid term, Short term Dec 1, 2014
@quba
Copy link
Contributor

quba commented Dec 1, 2014

Remember which SQL query was executed and do not execute it again

Yes, but only in case query was executed without errors (possible on bigger databases).

@mattab
Copy link
Member

mattab commented Mar 24, 2015

wants to perform other logic done 'under the hood' (i.e. plugins name change, plugin activation etc) - but currently this is impossible, as Piwik update will notice core_version in piwik_option table set to latest possible, and will omit all the logic that hasn't been executed.

This was fixed in #6760 by hiding the core_version SQL from the list of queries.
So now even when copy pasting the list of queries it will still show the update screen to run any non-sql upgrades.

@mattab
Copy link
Member

mattab commented Mar 24, 2015

What would be the most useful next step for improving the core:update experience, if something needs to be done soon? otherwise I leave the issue opened for further suggestion and feedback!

@mattab mattab modified the milestones: Long term, Mid term Dec 5, 2016
@mattab
Copy link
Member

mattab commented Sep 18, 2017

#5985

@mattab mattab closed this as completed Sep 18, 2017
@mattab mattab added the duplicate For issues that already existed in our issue tracker and were reported previously. label Sep 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Usability For issues that let users achieve a defined goal more effectively or efficiently. duplicate For issues that already existed in our issue tracker and were reported previously. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

4 participants