fix user table creation

This commit is contained in:
Colin McKechney
2023-04-30 19:45:21 -04:00
parent 402dcd8efe
commit bbab7882cc
2 changed files with 3 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
pub mod user; pub mod user;
pub mod eatery; pub mod eatery;
pub mod plan; pub mod plan;
pub mod week;

View File

@@ -154,9 +154,9 @@ fn create_user(username: &str, password: &str, first_name: &str, last_name: &str
} }
}; };
let mut new_table = conn.statement("create table :net_id ( item_id number(5), foreign key (item_id) references menu_item (id))").build()?; let mut new_table = conn.statement(format!("create table {} ( item_id number(5), foreign key (item_id) references menu_item (id))", username).as_str()).build()?;
match new_table.execute_named(&[("net_id", &username)]) { match new_table.execute(&[]) {
Ok(_) => { Ok(_) => {
info!("User {} week table created", username); info!("User {} week table created", username);
conn.commit()?; conn.commit()?;