diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-11-25 17:31:44 -0600 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2020-12-02 10:43:22 -0600 |
commit | e8a4062d9dc042253adc05f2ab964bbd468ace12 (patch) | |
tree | a310a8f656e385bb086095458f7074f0fe980bb6 /lib/mix/tasks | |
parent | a82ba66662fdcdccf0de384b0f57dd20bef0fd9d (diff) | |
download | pleroma-e8a4062d9dc042253adc05f2ab964bbd468ace12.tar.gz |
Document how to delete individual configuration groups and completely reset the config without SQL
Diffstat (limited to 'lib/mix/tasks')
-rw-r--r-- | lib/mix/tasks/pleroma/config.ex | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/mix/tasks/pleroma/config.ex b/lib/mix/tasks/pleroma/config.ex index 675dda0d0..574f8f4be 100644 --- a/lib/mix/tasks/pleroma/config.ex +++ b/lib/mix/tasks/pleroma/config.ex @@ -83,6 +83,19 @@ defmodule Mix.Tasks.Pleroma.Config do end end + def run(["reset"]) do + with true <- Pleroma.Config.get([:configurable_from_database]) do + start_pleroma() + + Ecto.Adapters.SQL.query!(Repo, "TRUNCATE config;") + Ecto.Adapters.SQL.query!(Repo, "ALTER SEQUENCE config_id_seq RESTART;") + + shell_info("The ConfigDB settings have been removed from the database.") + else + _ -> configdb_not_enabled() + end + end + def run(["keydel" | dbkey]) do unless [] == dbkey do with true <- Pleroma.Config.get([:configurable_from_database]) do |