fix: Schema alignment and code corrections (COA 2)
All checks were successful
Test Asgard Runner / test (push) Successful in 3s

- Replace owner_id → owner_user_id in all queries
- Replace auth_token → companion_agent_token in server_connections
- Replace l.active → (l.status = 'active') checks using ENUM
- Fix AppError → ApiError in all new API files
- Add missing imports (Path, PanelAdapter trait)
- Fix StoreConfig nullable type mismatches

Resolves 122 compilation errors. Only sqlx cache generation remains.

Phase 3: EXECUTE complete per V4_WORKFLOW
This commit is contained in:
Vantz Stockwell
2026-02-15 18:23:33 -05:00
parent d7dddca106
commit 500d92cbe3
8 changed files with 342 additions and 82 deletions

View File

@@ -52,7 +52,7 @@ impl HostProvisioningService {
// Create license
let license_id = sqlx::query_scalar!(
"INSERT INTO licenses (license_key, owner_id, server_name, subdomain)
"INSERT INTO licenses (license_key, owner_user_id, server_name, subdomain)
VALUES ($1, $2, $3, $4)
RETURNING id",
license_key,
@@ -79,9 +79,9 @@ impl HostProvisioningService {
// Store companion token
sqlx::query!(
"INSERT INTO server_connections (license_id, connection_type, auth_token)
"INSERT INTO server_connections (license_id, connection_type, companion_agent_token)
VALUES ($1, 'bare_metal', $2)
ON CONFLICT (license_id) DO UPDATE SET auth_token = $2",
ON CONFLICT (license_id) DO UPDATE SET companion_agent_token = $2",
license_id,
companion_token
)
@@ -150,7 +150,7 @@ impl HostProvisioningService {
let count = sqlx::query_scalar!(
"SELECT COUNT(*) FROM host_licenses hl
INNER JOIN licenses l ON l.id = hl.license_id
WHERE hl.host_id = $1 AND l.active = true",
WHERE hl.host_id = $1 AND l.status = 'active'",
host_id
)
.fetch_one(&self.db)

View File

@@ -6,6 +6,7 @@ use uuid::Uuid;
use super::amp_adapter::AmpAdapter;
use super::encryption;
use super::nats_bridge::NatsBridge;
use super::panel_adapter::PanelAdapter;
use super::pterodactyl_adapter::PterodactylAdapter;
/// Default timeout for module installation operations (60 seconds).