mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 20:56:49 +00:00
refactor: Remove some unnecessary macro logic
This commit is contained in:
1 parent
23d07e3d4f
commit
48c36d6f17
1 file changed
+2
-4
@@ -51,10 +51,8 @@ static MIGRATIONS: &[DatabaseMigrationStep] = const {
|
|||||||
Migration($name, |services| {
|
Migration($name, |services| {
|
||||||
Box::pin(async {
|
Box::pin(async {
|
||||||
let db = &services.db;
|
let db = &services.db;
|
||||||
#[allow(clippy::string_lit_as_bytes)]
|
|
||||||
let key = $name.as_bytes();
|
|
||||||
|
|
||||||
if db["global"].get(key).await.is_not_found() {
|
if db["global"].get($name).await.is_not_found() {
|
||||||
info!("Starting migration {}", $name);
|
info!("Starting migration {}", $name);
|
||||||
let cork = db.cork_and_sync();
|
let cork = db.cork_and_sync();
|
||||||
|
|
||||||
@@ -63,7 +61,7 @@ static MIGRATIONS: &[DatabaseMigrationStep] = const {
|
|||||||
.map_err(|err| err!("Failed to run migration {}: {err}", $name))?;
|
.map_err(|err| err!("Failed to run migration {}: {err}", $name))?;
|
||||||
|
|
||||||
drop(cork);
|
drop(cork);
|
||||||
db["global"].insert(key, []);
|
db["global"].insert($name, []);
|
||||||
db.db.sort()?;
|
db.db.sort()?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user