-
-
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
Add migration for password algorithm change #12784
Add migration for password algorithm change #12784
Conversation
go-gitea#12688 changed the default for the user table leading to sync2 warnings Unfortunately changing defaults requires a complete table rewrite in general. However, just dropping columns could be bad - so this PR leverages the techniques used in recreate table to recreate from the inferred schema and recreates the user table. This is not necessarily the correct thing to do - but code sometimes speaks louder than words. Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Tested, worked for me. |
This comment has been minimized.
This comment has been minimized.
Maybe it's worth to move some of the code to (future) shared function? |
Signed-off-by: Andrew Thornton <art27@cantab.net>
OK the indices are correct for the user table |
Codecov Report
@@ Coverage Diff @@
## master #12784 +/- ##
==========================================
- Coverage 43.16% 43.08% -0.08%
==========================================
Files 654 655 +1
Lines 72200 72325 +125
==========================================
Hits 31163 31163
- Misses 35986 36117 +131
+ Partials 5051 5045 -6
Continue to review full report at Codecov.
|
@zeripath does recreateTable not cover this case? |
It's an option. I thought I'd write this to show what a non-recreate table solution looks like - this one means that any columns that are excess will not be deleted. Happy to drop the SQLite3 solution to use recreateTable though. |
please resolve conflicts |
Signed-off-by: Andrew Thornton <art27@cantab.net>
🚀 |
#12688 changed the default for the user table leading to sync2 warnings
Unfortunately changing defaults requires a complete table rewrite in general.
However, just dropping columns could be bad - so this PR leverages the
techniques used in recreate table to recreate from the inferred schema
and recreates the user table.
This is not necessarily the correct thing to do - but code sometimes speaks
louder than words.
Signed-off-by: Andrew Thornton art27@cantab.net