From 008a7716de5dab714e0826bf301e5dc3e87029f3 Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Fri, 18 Aug 2023 12:25:40 +1200 Subject: [PATCH] restructure migration directory --- src/storage/migrations/mod.rs | 2 -- src/storage/mod.rs | 1 + src/storage/{migrations/settings => types}/mod.rs | 6 ++++-- src/storage/{migrations/settings => types}/settings1.rs | 0 src/storage/{migrations/settings => types}/settings2.rs | 0 src/storage/{migrations/settings => types}/theme1.rs | 0 6 files changed, 5 insertions(+), 4 deletions(-) rename src/storage/{migrations/settings => types}/mod.rs (93%) rename src/storage/{migrations/settings => types}/settings1.rs (100%) rename src/storage/{migrations/settings => types}/settings2.rs (100%) rename src/storage/{migrations/settings => types}/theme1.rs (100%) diff --git a/src/storage/migrations/mod.rs b/src/storage/migrations/mod.rs index c0fdf95f..4d21bac0 100644 --- a/src/storage/migrations/mod.rs +++ b/src/storage/migrations/mod.rs @@ -4,8 +4,6 @@ use heed::RwTxn; use nostr_types::{Event, RelayUrl}; use speedy::Readable; -mod settings; - impl Storage { const MAX_MIGRATION_LEVEL: u32 = 3; diff --git a/src/storage/mod.rs b/src/storage/mod.rs index cfcb17d0..e4b810f4 100644 --- a/src/storage/mod.rs +++ b/src/storage/mod.rs @@ -1,5 +1,6 @@ mod import; mod migrations; +mod types; use crate::error::{Error, ErrorKind}; use crate::globals::GLOBALS; diff --git a/src/storage/migrations/settings/mod.rs b/src/storage/types/mod.rs similarity index 93% rename from src/storage/migrations/settings/mod.rs rename to src/storage/types/mod.rs index 7fbc0a96..625a8844 100644 --- a/src/storage/migrations/settings/mod.rs +++ b/src/storage/types/mod.rs @@ -3,12 +3,14 @@ // to look like. mod settings1; -use settings1::Settings1; +pub use settings1::Settings1; mod settings2; -use settings2::Settings2; +pub use settings2::Settings2; mod theme1; +pub use theme1::{Theme1, ThemeVariant1}; + use crate::error::Error; use crate::storage::Storage; diff --git a/src/storage/migrations/settings/settings1.rs b/src/storage/types/settings1.rs similarity index 100% rename from src/storage/migrations/settings/settings1.rs rename to src/storage/types/settings1.rs diff --git a/src/storage/migrations/settings/settings2.rs b/src/storage/types/settings2.rs similarity index 100% rename from src/storage/migrations/settings/settings2.rs rename to src/storage/types/settings2.rs diff --git a/src/storage/migrations/settings/theme1.rs b/src/storage/types/theme1.rs similarity index 100% rename from src/storage/migrations/settings/theme1.rs rename to src/storage/types/theme1.rs