use surrealdb::{engine::remote::ws::{Client, Ws}, opt::auth::Root, Surreal};
#[derive(rust_embed::RustEmbed)]
#[folder = "tests/migrations"]
struct MigrationFiles;
#[derive(rust_embed::RustEmbed)]
#[folder = "tests/schema"]
struct SchemaFiles;
#[tokio::test]
async fn create_migration_table_if_not_exists() {
tracing_subscriber::fmt::init();
let client: Surreal<Client> = Surreal::new::<Ws>("127.0.0.1:8000").await.unwrap();
client.signin(Root {
username: "root",
password: "root",
})
.await.unwrap();
client.use_ns("system").use_db("system").await.unwrap();
surrealdb_migration_engine::run::<MigrationFiles,SchemaFiles>(&client).await.unwrap();
}