feat: add migration for userdata

This commit is contained in:
dettlaff 2024-06-16 23:48:25 +04:00 committed by Inex Code
parent 7b9420c244
commit 82a0b557e1

View file

@ -0,0 +1,25 @@
from selfprivacy_api.migrations.migration import Migration
from selfprivacy_api.utils import ReadUserData, WriteUserData
class UpdateServicesFlakeList(Migration):
"""Check if all required services are in the flake list"""
def get_migration_name(self):
return "update_services_flake_list"
def get_migration_description(self):
return "Check if all required services are in the flake list"
def is_migration_needed(self):
with ReadUserData() as data:
if "roundcube" not in data["modules"]:
return True
def migrate(self):
with WriteUserData() as data:
data["modules"]["roundcube"] = {
"enable": True,
"subdomain": "roundcube",
}