Compare commits

..
Author SHA1 Message Date
Paul 0fe63e3955 chore: bump rauth revision and version to 0.5.3-alpha.11 2021-11-28 17:58:24 +00:00
Paul 4474061103 chore: bump to 0.5.3-alpha.10 2021-11-23 08:57:34 +00:00
Paul 788580a64f fix: broken index migration
feat: add new index
2021-11-23 08:57:17 +00:00
6 changed files with 39 additions and 9 deletions

No files matched your search

Generated
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
+9 -2
View File
@@ -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": {
+26 -3
View File
@@ -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
View File
@@ -1 +1 @@
pub const VERSION: &str = "0.5.3-alpha.9";
pub const VERSION: &str = "0.5.3-alpha.11";