Add migration
This commit is contained in:
parent
59beb3a092
commit
61f53bbb7e
@ -2,10 +2,16 @@
|
|||||||
|
|
||||||
set -eu -o pipefail
|
set -eu -o pipefail
|
||||||
|
|
||||||
|
setup_db() {
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
gitea migrate
|
||||||
|
}
|
||||||
|
|
||||||
setup_root_user() {
|
setup_root_user() {
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
user_count=$(sqlite3 /data/gitea.db "SELECT count(*) FROM user;")
|
user_count=$(sqlite3 /data/gitea.db "SELECT count(*) FROM USER;")
|
||||||
|
|
||||||
if [[ "${user_count}" == "0" ]]; then
|
if [[ "${user_count}" == "0" ]]; then
|
||||||
echo "==> Setting up root user for first run"
|
echo "==> Setting up root user for first run"
|
||||||
@ -22,6 +28,7 @@ setup_root_user() {
|
|||||||
main() {
|
main() {
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
setup_db
|
||||||
setup_root_user
|
setup_root_user
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user