Fix database scheme and introduce automatic database migration

This commit is contained in:
2026-01-19 23:22:16 +01:00
parent 6fb38a795c
commit cc40c33dc9
5 changed files with 114 additions and 42 deletions

View File

@@ -15,7 +15,6 @@ from .cli import (
cmd_hostname_delete,
cmd_hostname_list,
cmd_hostname_modify,
cmd_init_db,
cmd_user_add,
cmd_user_delete,
cmd_user_email,
@@ -94,12 +93,14 @@ def build_parser():
"delete", help="Delete hostname"
)
hostname_delete.add_argument("hostname", help="Hostname (FQDN)")
hostname_delete.add_argument("zone", help="DNS zone")
hostname_delete.set_defaults(func=cmd_hostname_delete)
hostname_modify = hostname_subparsers.add_parser(
"modify", help="Modify hostname"
)
hostname_modify.add_argument("hostname", help="Hostname (FQDN)")
hostname_modify.add_argument("zone", help="DNS zone")
hostname_modify.add_argument("--dns-ttl", type=int, help="DNS record TTL")
hostname_modify.add_argument("--expiry-ttl", type=int, help="Expiry TTL")
hostname_modify.set_defaults(func=cmd_hostname_modify)
@@ -163,7 +164,7 @@ def main():
# Handle --init-db
if args.init_db:
return cmd_init_db(args, app)
return
# Handle --daemon
if args.daemon: