fix: add migration to migration list

This commit is contained in:
dettlaff 2024-07-18 20:40:18 +04:00
parent 5bb49f2109
commit f3f1114bc6
2 changed files with 5 additions and 3 deletions

View file

@ -14,10 +14,12 @@ from selfprivacy_api.migrations.write_token_to_redis import WriteTokenToRedis
from selfprivacy_api.migrations.check_for_system_rebuild_jobs import ( from selfprivacy_api.migrations.check_for_system_rebuild_jobs import (
CheckForSystemRebuildJobs, CheckForSystemRebuildJobs,
) )
from selfprivacy_api.add_prometheus import AddPrometheus
migrations = [ migrations = [
WriteTokenToRedis(), WriteTokenToRedis(),
CheckForSystemRebuildJobs(), CheckForSystemRebuildJobs(),
AddPrometheus(),
] ]

View file

@ -25,9 +25,9 @@ class AddPrometheus(Migration):
def migrate(self) -> None: def migrate(self) -> None:
with FlakeServiceManager() as manager: with FlakeServiceManager() as manager:
if "prometheus" not in manager.services: if "prometheus" not in manager.services:
manager.services["prometheus"] = ( manager.services[
"git+https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git?ref=flakes&dir=sp-modules/prometheus" "prometheus"
) ] = "git+https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git?ref=flakes&dir=sp-modules/prometheus"
with WriteUserData() as data: with WriteUserData() as data:
if "prometheus" not in data["modules"]: if "prometheus" not in data["modules"]:
data["modules"]["prometheus"] = { data["modules"]["prometheus"] = {