mirror of
https://github.com/CloudNebulaProject/barycenter.git
synced 2026-04-10 21:20:41 +00:00
Replace raw SQL CREATE TABLE statements with proper SeaORM migration system. This eliminates verbose SQL logs on startup and provides proper migration tracking and rollback support. Changes: - Add sea-orm-migration dependency and migration crate - Create initial migration (m20250101_000001) with all 8 tables - Update storage::init() to only connect to database - Run migrations automatically in main.rs on startup - Remove unused detect_backend() function and imports The migration system properly handles both SQLite and PostgreSQL backends with appropriate type handling (e.g., BIGSERIAL vs INTEGER for auto-increment columns). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
17 lines
390 B
TOML
17 lines
390 B
TOML
[package]
|
|
name = "migration"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
publish = false
|
|
|
|
[lib]
|
|
name = "migration"
|
|
path = "src/lib.rs"
|
|
|
|
[dependencies]
|
|
sea-orm-migration = { version = "1", features = ["sqlx-sqlite", "sqlx-postgres", "runtime-tokio-rustls"] }
|
|
|
|
[dependencies.sea-orm]
|
|
version = "1"
|
|
features = ["sqlx-sqlite", "sqlx-postgres", "runtime-tokio-rustls", "macros"]
|
|
default-features = false
|