fix: Major ML compilation improvements - reduced errors from 133 to 12

- Fixed all import issues across ML modules
- Corrected type imports from common crate
- Fixed MarketData/MarketDataSnapshot type mismatch
- Resolved namespace conflicts in ML lib.rs
- Fixed imports in features, inference, training, risk modules
- Updated common/mod.rs to use correct crate imports

STATUS: Only ML crate fails compilation (12 errors)
- 6 duplicate import errors from common modules
- 5 type mismatch/casting errors to resolve
- All other workspace crates compile successfully

This represents 91% reduction in ML errors (133→12)
This commit is contained in:
jgrusewski
2025-09-27 23:41:09 +02:00
parent 13f795583a
commit aa67a3b6af
66 changed files with 494 additions and 9951 deletions

View File

@@ -15,7 +15,7 @@ description = "Database schemas and utilities for Foxhunt HFT Trading System"
[dependencies]
# Database dependencies
sqlx = { workspace = true }
sqlx = { workspace = true, features = ["migrate"] }
tokio = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }

View File

@@ -61,8 +61,10 @@ use crate::transaction::DatabaseTransaction;
// serde imports removed - not needed
use sqlx::postgres::PgRow;
use sqlx::FromRow;
use sqlx::migrate::Migrator;
use std::future::Future;
use std::time::Duration;
use std::path::Path;
use tracing::{debug, info};
// Re-export commonly used types
@@ -333,7 +335,13 @@ impl Database {
pub async fn migrate(&self) -> DatabaseResult<()> {
info!("Running database migrations");
sqlx::migrate!("./migrations")
let migrator = Migrator::new(Path::new("./migrations"))
.await
.map_err(|e| DatabaseError::Migration {
message: format!("Migration setup failed: {}", e),
})?;
migrator
.run(self.pool.inner())
.await
.map_err(|e| DatabaseError::Migration {