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

38
generate-sqlx-cache.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/bash
set -e
echo "=== GENERATING SQLX QUERY CACHE ==="
echo ""
# Install sqlx-cli if not present
if ! command -v cargo-sqlx &> /dev/null; then
echo "Installing sqlx-cli..."
cargo install sqlx-cli --no-default-features --features postgres
fi
# Set DATABASE_URL to local postgres container
export DATABASE_URL="postgres://corrosion:${DB_PASSWORD:-corrosion_dev}@localhost:5432/corrosion"
echo "Testing database connection..."
if ! psql "$DATABASE_URL" -c "SELECT 1" > /dev/null 2>&1; then
echo "❌ Cannot connect to database. Make sure PostgreSQL container is running."
echo " Run: docker ps | grep corrosion-db"
exit 1
fi
echo "✅ Database connection successful"
echo ""
cd ~/corrosion-admin-panel/backend
echo "Generating sqlx query cache..."
cargo sqlx prepare --workspace
echo ""
echo "✅ Query cache generated in .sqlx/ directory"
echo ""
echo "Now commit and push the cache:"
echo " git add .sqlx/"
echo " git commit -m 'chore: Add sqlx offline query cache'"
echo " git push"
echo ""