2023-06-06 10:27:02 -04:00
|
|
|
#![feature(default_free_fn)]
|
|
|
|
mod db;
|
|
|
|
mod error;
|
2023-06-06 11:27:37 -04:00
|
|
|
mod migrator;
|
2023-06-06 10:27:02 -04:00
|
|
|
use error::Result;
|
|
|
|
use sea_orm::Database;
|
2023-06-06 12:46:35 -04:00
|
|
|
use sea_orm_migration::prelude::*;
|
2023-06-06 10:27:02 -04:00
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
async fn main() -> Result<()> {
|
|
|
|
let db = Database::connect(db::connection_url()).await?;
|
2023-06-06 12:46:35 -04:00
|
|
|
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?);
|
2023-06-06 10:27:02 -04:00
|
|
|
Ok(println!("Hello, world! {db:?}"))
|
|
|
|
}
|