From e38cfca945233ebe6f5cea4e6d99bd96dd44c892 Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Sat, 12 Nov 2022 18:53:59 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Acceso=20a=20db=20es=20caracter?= =?UTF-8?q?=C3=ADstica=20de=20compilaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagetop/src/app.rs | 5 ++++- pagetop/src/core/module/all.rs | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pagetop/src/app.rs b/pagetop/src/app.rs index bef02b29..8e856131 100644 --- a/pagetop/src/app.rs +++ b/pagetop/src/app.rs @@ -4,7 +4,10 @@ use crate::core::{module, theme}; use crate::html::Markup; use crate::response::page::ResultPage; use crate::response::FatalError; -use crate::{config, db, locale, server, trace, LazyStatic}; +use crate::{config, locale, server, trace, LazyStatic}; + +#[cfg(feature = "database")] +use crate::db; use actix_web::dev::Server; diff --git a/pagetop/src/core/module/all.rs b/pagetop/src/core/module/all.rs index c1162c60..84f55b47 100644 --- a/pagetop/src/core/module/all.rs +++ b/pagetop/src/core/module/all.rs @@ -2,7 +2,7 @@ use super::ModuleStaticRef; use crate::core::hook::add_action; use crate::core::theme; -use crate::{db, server, trace, LazyStatic}; +use crate::{server, trace, LazyStatic}; #[cfg(feature = "database")] use crate::{db::*, run_now}; @@ -110,7 +110,7 @@ pub fn run_migrations() { migrations } } - Migrator::up(&db::DBCONN, None) + Migrator::up(&DBCONN, None) }) .unwrap(); @@ -125,7 +125,7 @@ pub fn run_migrations() { migrations } } - Migrator::down(&db::DBCONN, None) + Migrator::down(&DBCONN, None) }) .unwrap(); }