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

Convert database.xml to migrations #865

Closed
PVince81 opened this issue Jun 17, 2021 · 9 comments
Closed

Convert database.xml to migrations #865

PVince81 opened this issue Jun 17, 2021 · 9 comments

Comments

@PVince81
Copy link
Contributor

As of Nextcloud 22, the database.xml file has been deprecated:

% occ app:enable music
The appinfo/database.xml file is not longer supported. Used in music

we should migrate it to DB migrations

@PVince81
Copy link
Contributor Author

@paulijar
Copy link
Collaborator

Actually, that has already been handled by the commit 6982d91. But I guess I need to make a new Music app release including this commit soon, as the release of NC22 is closing in. Any idea about when the RC1 will be available? I wouldn't want to claim support for NC22 before actually testing with a release candidate; it has happened before that the compatibility has broken between the beta releases.

@PVince81
Copy link
Contributor Author

Ah, nice! NC 22 is currently on 22.0.0beta5, not sure about the timeline for RC1 though.
Considering that many betas I guess it should be in the coming weeks.

@PVince81
Copy link
Contributor Author

@paulijar
Copy link
Collaborator

Okay, thanks for the info!

@paulijar
Copy link
Collaborator

Music v1.2.1 with support for NC22 is now released.

@PVince81
Copy link
Contributor Author

Thanks for the release! 👍

I've updated to that version from NC 21 and did a quick test with the following, which worked fine:

  • search in web UI
  • playback in web UI
  • playlist listing and playback

also worked with the Ultrasonic Android app for playlist listing and playback.

@stefan123t
Copy link

@paulijar, thanks for your commit, this is very instructive for other apps too!

@paulijar
Copy link
Collaborator

@stefan123t No problem. If other apps use this as reference, then they should notice that there are some pit holes in the automatically generated Migration script as included in 6982d91. It does work correctly when installing on a clean environment, or an environment which already has an up-to-date database schema. But it cannot handle situations where there is an outdated DB schema from an older version of the app, and some existing table would need to be modified by adding and/or removing columns or indexes.

To overcome this, my final implementation for the first Migrations script is like this: https://github.com/owncloud/music/blob/master/lib/Migration/Version010300Date20210906093000.php. It's fully hand-crafted although based on the automatically generated first version. It should now do the job, no matter which previous version of the Music app the user might have installed.

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

No branches or pull requests

3 participants