(* Database initialization script *) open Lwt.Infix let () = (* Initialize logger *) Logs.set_reporter (Logs_fmt.reporter ()); Logs.set_level (Some Logs.Debug); (* Get database URL *) let db_url = try Sys.getenv "DATABASE_URL" with Not_found -> "postgresql://monitor_user:changeme@localhost:5432/website_monitor" in Printf.printf "Database URL: %s\n" db_url; (* Initialize database connection *) let pool = Database.pool in (* Initialize schema *) Database.init_schema () >>= fun () -> Lwt_io.printl "Database initialized successfully!" >>= fun () -> Lwt.return_unit let () = Lwt_main.run @@ begin Database.init_schema () >>= fun () -> Lwt_io.printl "Database schema initialized successfully!" >>= fun () -> Lwt.return_unit end