diff --git a/src/db.rs b/src/db.rs index f7c01ff..22ddb10 100644 --- a/src/db.rs +++ b/src/db.rs @@ -146,9 +146,9 @@ pub async fn connect(config: &Config) -> surrealdb::Result> { .await?; let setup = include_bytes!("setup.surql"); - let file = setup.iter().map(|c| *c as char).collect::(); + let init_commands = setup.iter().map(|c| *c as char).collect::(); - db.query(file) + db.query(init_commands) .await .expect("Failed to setup surreal tables."); diff --git a/src/setup.surql b/src/setup.surql index ab3d387..abcf3ba 100644 --- a/src/setup.surql +++ b/src/setup.surql @@ -14,3 +14,5 @@ DEFINE FUNCTION OVERWRITE fn::get_next($filter: string) { UPDATE $site.id SET processing = true; RETURN $site }; + +UPDATE website SET processing = false WHERE processing = true;