aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/tutorial01/main.rs3
-rw-r--r--examples/tutorial02/main.rs3
-rw-r--r--examples/tutorial02/polls/migrations/mod.rs3
-rw-r--r--examples/tutorial02/polls/mod.rs3
4 files changed, 9 insertions, 3 deletions
diff --git a/examples/tutorial01/main.rs b/examples/tutorial01/main.rs
index 0fb087d..7426ab7 100644
--- a/examples/tutorial01/main.rs
+++ b/examples/tutorial01/main.rs
@@ -1,5 +1,6 @@
use tosin::Settings;
use tosin::contrib::admin;
+use tosin::db::backend::Connectable;
use tosin::urls::{UrlMap, url_map};
mod polls;
@@ -11,7 +12,7 @@ fn urls() -> UrlMap {
}
}
-fn settings() -> Settings {
+fn settings() -> Settings<impl Connectable> {
Settings {
..Settings::default()
}
diff --git a/examples/tutorial02/main.rs b/examples/tutorial02/main.rs
index eeb7524..0f8dc11 100644
--- a/examples/tutorial02/main.rs
+++ b/examples/tutorial02/main.rs
@@ -1,5 +1,6 @@
use tosin::Settings;
use tosin::contrib::admin;
+use tosin::db::backend::Connectable;
use tosin::urls::{UrlMap, url_map};
mod polls;
@@ -11,7 +12,7 @@ fn urls() -> UrlMap {
}
}
-fn settings() -> Settings {
+fn settings() -> Settings<impl Connectable> {
Settings {
installed_apps: &[
&polls::APP,
diff --git a/examples/tutorial02/polls/migrations/mod.rs b/examples/tutorial02/polls/migrations/mod.rs
new file mode 100644
index 0000000..64efe8d
--- /dev/null
+++ b/examples/tutorial02/polls/migrations/mod.rs
@@ -0,0 +1,3 @@
+use tosin::db::migration::{Migration, gather};
+
+gather!();
diff --git a/examples/tutorial02/polls/mod.rs b/examples/tutorial02/polls/mod.rs
index f4fde54..4b5de71 100644
--- a/examples/tutorial02/polls/mod.rs
+++ b/examples/tutorial02/polls/mod.rs
@@ -1,5 +1,6 @@
use tosin::apps::AppConfig;
+mod migrations;
pub mod models;
pub mod urls;
pub mod views;
@@ -7,5 +8,5 @@ pub mod views;
pub use urls::urls;
pub const APP: AppConfig = AppConfig {
-
+ migrations: migrations::migrations,
};