diff options
author | zeripath <art27@cantab.net> | 2020-09-06 22:52:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-06 22:52:01 +0100 |
commit | 1b9d5074a7ebb1b470f468cc9195d54915291ee3 (patch) | |
tree | 1045623ccc744aedb934017f6bf8ae345131db17 /docs | |
parent | ad2bf376dfd934394cad46c3ff3e022ca232958f (diff) | |
download | gitea-1b9d5074a7ebb1b470f468cc9195d54915291ee3.tar.gz gitea-1b9d5074a7ebb1b470f468cc9195d54915291ee3.zip |
Add command to recreate tables (#12407)
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 #8868
Fix #3265
Fix #8894
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/content/doc/usage/command-line.en-us.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/content/doc/usage/command-line.en-us.md b/docs/content/doc/usage/command-line.en-us.md index e458b11ba4..49df30edb0 100644 --- a/docs/content/doc/usage/command-line.en-us.md +++ b/docs/content/doc/usage/command-line.en-us.md @@ -319,6 +319,36 @@ var checklist = []check{ This function will receive a command line context and return a list of details about the problems or error. +##### doctor recreate-table + +Sometimes when there are migrations the old columns and default values may be left +unchanged in the database schema. This may lead to warning such as: + +``` +2020/08/02 11:32:29 ...rm/session_schema.go:360:Sync2() [W] Table user Column keep_activity_private db default is , struct default is 0 +``` + +You can cause Gitea to recreate these tables and copy the old data into the new table +with the defaults set appropriately by using: + +``` +gitea doctor recreate-table user +``` + +You can ask gitea to recreate multiple tables using: + +``` +gitea doctor recreate-table table1 table2 ... +``` + +And if you would like Gitea to recreate all tables simply call: + +``` +gitea doctor recreate-table +``` + +It is highly recommended to back-up your database before running these commands. + #### manager Manage running server operations: |