klesh opened a new issue, #2440: URL: https://github.com/apache/incubator-devlake/issues/2440
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and found no similar feature requirement. ### Description During v0.12 development, have added `connection` entity to many plugins which previously support only single connection, which effectively invalidates whatever data exists in the database. So, we all agreed that it is safely to purge those data to maintain data integrity. But it poses another problem here: We are going to delete data silently, and it may be undesirable for some users. It is important for our users to know what is going to happen at what cost, and offer them a chance to stop the Migration. I propose that we should do the following steps to make it happen: 1. Add `GET /status` API to BE, when BE detects Migration is happening, disable all other APIs, and all APIs including `GET /status` should return some kind of 400 error response like the following: ``` { "success": false, "message": "System halt due to Pending Database Migration was detected, it might purge expired data and cripple your dashborads. Send a Post request to /status/migrate if that is ok for you" } ``` 2. Add `POST /status/migrate` to BE, when it is called, migrate the database, and enable all APIs 3. Config-UI to adopt the API, and prompt users accordingly ### Use case 1. Users may know what is the stake 2. Users may have a chance to stop Migration if they have an extensive database and do not want to drop data for the time being. ### Related issues _No response_ ### Are you willing to submit a PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
