]> source.dussan.org Git - gitea.git/commit
Add migration for password algorithm change (#12784)
authorzeripath <art27@cantab.net>
Tue, 15 Sep 2020 22:02:41 +0000 (23:02 +0100)
committerGitHub <noreply@github.com>
Tue, 15 Sep 2020 22:02:41 +0000 (18:02 -0400)
commit772b5e0f548548d5633b99fb40f59e5075f1c6db
treee9071952fda509af176dab0da2d5e375d86aef68
parent88823f3e29385922cffab697d8d9f5a9a2ad3e42
Add migration for password algorithm change (#12784)

* Add migration for password algorithm change

#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>
* oops

Signed-off-by: Andrew Thornton <art27@cantab.net>
* ok lets use the shorter bits for other dbs

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update models/migrations/v150.go

* Update models/migrations/v150.go

* fix migration

Signed-off-by: Andrew Thornton <art27@cantab.net>
* mv v150 to v151.go

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Makefile
models/migrations/migrations.go
models/migrations/v151.go [new file with mode: 0644]