-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Clean Up Database When Upgrading #3265
Comments
We needs some button to clean up the database on admin panel after upgrade successfully. |
@lunny IMO the |
Dropping columns will not solve the defaults in struct are in sync right? We have seen this behaviour also from migration between 1.4.0 and 1.4.3.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
Hmm. I think we need to keep this issue around. @MTecknology is right. I guess there are two problems, I don't think it's good practice to go along destroying users data, so I would be loathe to suggest we rigidly enforce our current schema on databases - thus we may have to make a clean database CMD etc. The second issue is that we should probably change our migration scripts so that they automatically clean as they go along so this stops happening - (I think at migration it's fair enough to change schema relevant to the migration) |
@bkcsoft |
@zeripath this warning to help user to drop the columns or change the default value manually. |
Ok so auto drop at migration is probably a bad idea. @lunny do you think we should just leave it up to the users to drop the old columns then? |
FWIW, this was the first hit I got when searching Google for the ouput I see when starting up the latest 1.6.x version of gitea. If there is any action required on my part as a user, it's not immediately obvious. I'm a fairly new user to gitea, so I'm not sure I would notice if anything wasn't working quite right. |
Maybe we could add a new command cleanup to do that. We left some unused columns when database migrations for safe considering. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
I'm also seeing this issue on upgrading, running on MySQL. Is it safe for me to just drop those columns? |
It should be safe but gitea will not drop them automatically. But please backup before you do that. |
I'm actually getting a slightly different set of errors. If I delete all these columns then gitea gets bricked (e.g. I can't login):
|
For this default value problem, you cannot drop the columns. |
Provides new command: `gitea doctor recreate-table` which will recreate db tables and copy the old data in to the new table. This function can be used to remove the old warning of struct defaults being out of date. Fix go-gitea#8868 Fix go-gitea#3265 Fix go-gitea#8894 Signed-off-by: Andrew Thornton <art27@cantab.net>
[x]
):Description
Every upgrade seems to come with more and more of these lines. It doesn't seem like the schema update process is doing any clean-up and it doesn't seem that there is a manual process available.
The text was updated successfully, but these errors were encountered: