import migrations and don't require diesel_cli for admins (#555)

* import migrations via macro

* panic on database not to the latest migration

* add subcommand to plm

* create migration that run tantivy index creation

* remove diesel_cli from places it was

* use our migration system for tests

* create table __diesel_schema_migrations if needed
This commit is contained in:
fdb-hiroshima
2019-04-29 16:30:20 +02:00
committed by GitHub
parent ec57f1e687
commit 49bb8cb0bc
22 changed files with 475 additions and 66 deletions
+9 -4
View File
@@ -10,6 +10,7 @@ use plume_models::{Connection as Conn, CONFIG};
use std::io::{self, prelude::*};
mod instance;
mod migration;
mod search;
mod users;
@@ -19,8 +20,9 @@ fn main() {
.version(env!("CARGO_PKG_VERSION"))
.about("Collection of tools to manage your Plume instance.")
.subcommand(instance::command())
.subcommand(users::command())
.subcommand(search::command());
.subcommand(migration::command())
.subcommand(search::command())
.subcommand(users::command());
let matches = app.clone().get_matches();
dotenv::dotenv().ok();
@@ -30,12 +32,15 @@ fn main() {
("instance", Some(args)) => {
instance::run(args, &conn.expect("Couldn't connect to the database."))
}
("users", Some(args)) => {
users::run(args, &conn.expect("Couldn't connect to the database."))
("migration", Some(args)) => {
migration::run(args, &conn.expect("Couldn't connect to the database."))
}
("search", Some(args)) => {
search::run(args, &conn.expect("Couldn't connect to the database."))
}
("users", Some(args)) => {
users::run(args, &conn.expect("Couldn't connect to the database."))
}
_ => app.print_help().expect("Couldn't print help"),
};
}