1
0
Fork 0
forked from TWS/kalkutago
kalkutago/src/main.rs

20 lines
615 B
Rust

#![feature(default_free_fn)]
mod db;
mod error;
mod migrator;
use error::Result;
use sea_orm::Database;
use sea_orm_migration::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
let db = Database::connect(db::connection_url()).await?;
let schema_manager = SchemaManager::new(&db);
migrator::Migrator::refresh(&db).await?;
assert!(schema_manager.has_table("tracks").await?);
assert!(schema_manager.has_table("ticks").await?);
assert!(schema_manager.has_table("groups").await?);
assert!(schema_manager.has_table("track2groups").await?);
Ok(println!("Hello, world! {db:?}"))
}