forked from jmug/stoatchat
Re-write email backend, use SMTP directly.
This commit is contained in:
@@ -1,27 +1,33 @@
|
||||
use super::super::get_db;
|
||||
use super::scripts::LATEST_REVISION;
|
||||
|
||||
use mongodb::options::CreateCollectionOptions;
|
||||
use mongodb::bson::doc;
|
||||
use log::info;
|
||||
use mongodb::bson::doc;
|
||||
use mongodb::options::CreateCollectionOptions;
|
||||
|
||||
pub fn create_database() {
|
||||
info!("Creating database.");
|
||||
let db = get_db();
|
||||
|
||||
db.create_collection("users", None).expect("Failed to create users collection.");
|
||||
db.create_collection("channels", None).expect("Failed to create channels collection.");
|
||||
db.create_collection("guilds", None).expect("Failed to create guilds collection.");
|
||||
db.create_collection("members", None).expect("Failed to create members collection.");
|
||||
db.create_collection("messages", None).expect("Failed to create messages collection.");
|
||||
db.create_collection("migrations", None).expect("Failed to create migrations collection.");
|
||||
db.create_collection("users", None)
|
||||
.expect("Failed to create users collection.");
|
||||
db.create_collection("channels", None)
|
||||
.expect("Failed to create channels collection.");
|
||||
db.create_collection("guilds", None)
|
||||
.expect("Failed to create guilds collection.");
|
||||
db.create_collection("members", None)
|
||||
.expect("Failed to create members collection.");
|
||||
db.create_collection("messages", None)
|
||||
.expect("Failed to create messages collection.");
|
||||
db.create_collection("migrations", None)
|
||||
.expect("Failed to create migrations collection.");
|
||||
|
||||
db.create_collection(
|
||||
"pubsub",
|
||||
CreateCollectionOptions::builder()
|
||||
.capped(true)
|
||||
.size(1_000_000)
|
||||
.build()
|
||||
.build(),
|
||||
)
|
||||
.expect("Failed to create pubsub collection.");
|
||||
|
||||
@@ -31,9 +37,9 @@ pub fn create_database() {
|
||||
"_id": 0,
|
||||
"revision": LATEST_REVISION
|
||||
},
|
||||
None
|
||||
None,
|
||||
)
|
||||
.expect("Failed to save migration info.");
|
||||
|
||||
|
||||
info!("Created database.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user