mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2024-09-20 07:16:18 +08:00
Do not create tables when using SQL as an external directory (fixes #291)
This commit is contained in:
parent
349bbbbe05
commit
d5f356ae6f
|
@ -81,28 +81,21 @@ impl SQLReadReplica {
|
|||
}
|
||||
if !replicas.is_empty() {
|
||||
if create_tables {
|
||||
match &primary {
|
||||
let result = match &primary {
|
||||
#[cfg(feature = "postgres")]
|
||||
Store::PostgreSQL(store) => {
|
||||
if let Err(err) = store.create_tables().await {
|
||||
config.new_build_error(
|
||||
(&prefix, "primary"),
|
||||
format!("Failed to create tables: {err}"),
|
||||
);
|
||||
}
|
||||
}
|
||||
Store::PostgreSQL(store) => store.create_tables().await,
|
||||
#[cfg(feature = "mysql")]
|
||||
Store::MySQL(store) => {
|
||||
if let Err(err) = store.create_tables().await {
|
||||
Store::MySQL(store) => store.create_tables().await,
|
||||
_ => panic!("Invalid store type"),
|
||||
};
|
||||
|
||||
if let Err(err) = result {
|
||||
config.new_build_error(
|
||||
(&prefix, "primary"),
|
||||
format!("Failed to create tables: {err}"),
|
||||
);
|
||||
}
|
||||
}
|
||||
_ => panic!("Invalid store type"),
|
||||
}
|
||||
}
|
||||
|
||||
Some(Self {
|
||||
primary,
|
||||
|
|
Loading…
Reference in a new issue