mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-30 18:42:05 +00:00
feat(hydra): Bump database version
This commit is contained in:
parent
edb92f021b
commit
4446e96889
1 changed files with 6 additions and 1 deletions
|
@ -27,7 +27,7 @@ use crate::{Services, media};
|
||||||
/// - If database is opened at lesser version we apply migrations up to this.
|
/// - If database is opened at lesser version we apply migrations up to this.
|
||||||
/// Note that named-feature migrations may also be performed when opening at
|
/// Note that named-feature migrations may also be performed when opening at
|
||||||
/// equal or lesser version. These are expected to be backward-compatible.
|
/// equal or lesser version. These are expected to be backward-compatible.
|
||||||
pub(crate) const DATABASE_VERSION: u64 = 17;
|
pub(crate) const DATABASE_VERSION: u64 = 18;
|
||||||
|
|
||||||
pub(crate) async fn migrations(services: &Services) -> Result<()> {
|
pub(crate) async fn migrations(services: &Services) -> Result<()> {
|
||||||
let users_count = services.users.count().await;
|
let users_count = services.users.count().await;
|
||||||
|
@ -138,6 +138,11 @@ async fn migrate(services: &Services) -> Result<()> {
|
||||||
info!("Migration: Bumped database version to 17");
|
info!("Migration: Bumped database version to 17");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if services.globals.db.database_version().await < 18 {
|
||||||
|
services.globals.db.bump_database_version(18);
|
||||||
|
info!("Migration: Bumped database version to 18")
|
||||||
|
}
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
services.globals.db.database_version().await,
|
services.globals.db.database_version().await,
|
||||||
DATABASE_VERSION,
|
DATABASE_VERSION,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue