feat(backend): migration mekanizması, indeksler ve ortak model yardımcıları

- db/migrations.rs: schema_migrations ile sürümlü migration (v1: koleksiyonlar)
- db/indexes.rs: DATA_MODEL indeksleri + senkronizasyon indeksi, açılışta otomatik
- models/common.rs: UUID v7, ortak alanlar, hane kapsamlı filtre
- Birim testleri (4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-11 23:25:55 +03:00
parent 8ec24ecec2
commit 5550c7c43d
13 changed files with 367 additions and 34 deletions
+6
View File
@@ -2,6 +2,7 @@ mod config;
mod db;
#[allow(dead_code)] // AppError, Faz 1 – Adım 3 itibarıyla route'larda kullanılacak
mod error;
mod models;
mod routes;
mod state;
@@ -44,6 +45,11 @@ async fn main() -> ExitCode {
}
};
if let Err(e) = db::prepare(&db).await {
tracing::error!("Veritabanı hazırlanamadı (migration/indeks): {e}");
return ExitCode::FAILURE;
}
let port = config.port;
let state = AppState {
db,