add: journals base
add: avatar/banner upload endpoints
This commit is contained in:
parent
b3cac5f97a
commit
bb682add85
14 changed files with 323 additions and 22 deletions
21
crates/core/src/database/common.rs
Normal file
21
crates/core/src/database/common.rs
Normal file
|
@ -0,0 +1,21 @@
|
|||
use crate::{
|
||||
database::drivers::common,
|
||||
execute,
|
||||
model::{Error, Result},
|
||||
};
|
||||
|
||||
use super::DataManager;
|
||||
|
||||
impl DataManager {
|
||||
pub async fn init(&self) -> Result<()> {
|
||||
let conn = match self.connect().await {
|
||||
Ok(c) => c,
|
||||
Err(e) => return Err(Error::DatabaseConnection(e.to_string())),
|
||||
};
|
||||
|
||||
execute!(&conn, common::CREATE_TABLE_USERS, []).unwrap();
|
||||
execute!(&conn, common::CREATE_TABLE_PAGES, []).unwrap();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue