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:
@@ -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 }
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user