forked from jmug/stoatchat
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0fe63e3955 | ||
|
|
4474061103 | ||
|
|
788580a64f |
No files matched your search
Generated
+1
-1
@@ -2577,7 +2577,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rauth"
|
||||
version = "1.0.0"
|
||||
source = "git+https://github.com/insertish/rauth?rev=775a6f3ffb9ffc0e382af32fac2924e9a707e890#775a6f3ffb9ffc0e382af32fac2924e9a707e890"
|
||||
source = "git+https://github.com/insertish/rauth?rev=157263ffcbd6cb1073e288b215db227634c4c29a#157263ffcbd6cb1073e288b215db227634c4c29a"
|
||||
dependencies = [
|
||||
"async-std",
|
||||
"base32",
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ async-std = { version = "1.8.0", features = ["tokio1", "tokio02", "attributes"]
|
||||
web-push = "0.7.2"
|
||||
many-to-many = "0.1.2"
|
||||
lettre = "0.10.0-alpha.4"
|
||||
rauth = { git = "https://github.com/insertish/rauth", rev = "775a6f3ffb9ffc0e382af32fac2924e9a707e890" }
|
||||
rauth = { git = "https://github.com/insertish/rauth", rev = "157263ffcbd6cb1073e288b215db227634c4c29a" }
|
||||
hive_pubsub = { git = "https://gitlab.insrt.uk/insert/hive", rev = "b0f3db9d33990530d7640d4bbb309c8d9eb5c0cf", features = ["redis-backend"] }
|
||||
|
||||
# redis
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
export version=0.5.3-alpha.9
|
||||
export version=0.5.3-alpha.11
|
||||
echo "pub const VERSION: &str = \"${version}\";" > src/version.rs
|
||||
@@ -108,6 +108,13 @@ pub async fn create_database() {
|
||||
"channel": 1
|
||||
},
|
||||
"name": "channel"
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"channel": 1,
|
||||
"_id": 1
|
||||
},
|
||||
"name": "channel_id_compound"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -119,7 +126,7 @@ pub async fn create_database() {
|
||||
get_db()
|
||||
.run_command(
|
||||
doc! {
|
||||
"createIndexes": "messages",
|
||||
"createIndexes": "channel_unreads",
|
||||
"indexes": [
|
||||
{
|
||||
"key": {
|
||||
@@ -144,7 +151,7 @@ pub async fn create_database() {
|
||||
get_db()
|
||||
.run_command(
|
||||
doc! {
|
||||
"createIndexes": "messages",
|
||||
"createIndexes": "server_members",
|
||||
"indexes": [
|
||||
{
|
||||
"key": {
|
||||
|
||||
@@ -11,7 +11,7 @@ struct MigrationInfo {
|
||||
revision: i32,
|
||||
}
|
||||
|
||||
pub const LATEST_REVISION: i32 = 12;
|
||||
pub const LATEST_REVISION: i32 = 13;
|
||||
|
||||
pub async fn migrate_database() {
|
||||
let migrations = get_collection("migrations");
|
||||
@@ -396,7 +396,7 @@ pub async fn run_migrations(revision: i32) -> i32 {
|
||||
get_db()
|
||||
.run_command(
|
||||
doc! {
|
||||
"createIndexes": "messages",
|
||||
"createIndexes": "channel_unreads",
|
||||
"indexes": [
|
||||
{
|
||||
"key": {
|
||||
@@ -421,7 +421,7 @@ pub async fn run_migrations(revision: i32) -> i32 {
|
||||
get_db()
|
||||
.run_command(
|
||||
doc! {
|
||||
"createIndexes": "messages",
|
||||
"createIndexes": "server_members",
|
||||
"indexes": [
|
||||
{
|
||||
"key": {
|
||||
@@ -444,6 +444,29 @@ pub async fn run_migrations(revision: i32) -> i32 {
|
||||
.expect("Failed to create server_members index.");
|
||||
}
|
||||
|
||||
if revision <= 12 {
|
||||
info!("Running migration [revision 12 / 2021-11-21]: Add indexes to database.");
|
||||
|
||||
get_db()
|
||||
.run_command(
|
||||
doc! {
|
||||
"createIndexes": "messages",
|
||||
"indexes": [
|
||||
{
|
||||
"key": {
|
||||
"channel": 1,
|
||||
"_id": 1
|
||||
},
|
||||
"name": "channel_id_compound"
|
||||
}
|
||||
]
|
||||
},
|
||||
None,
|
||||
)
|
||||
.await
|
||||
.expect("Failed to create message index.");
|
||||
}
|
||||
|
||||
// Need to migrate fields on attachments, change `user_id`, `object_id`, etc to `parent`.
|
||||
|
||||
// Reminder to update LATEST_REVISION when adding new migrations.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
pub const VERSION: &str = "0.5.3-alpha.9";
|
||||
pub const VERSION: &str = "0.5.3-alpha.11";
|
||||
Reference in new issue
Block a user