feat(server): 'seed' subcommand wiring the Spectrum cataloguing seed (#14)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use clap::{Parser, Subcommand, ValueEnum};
|
||||
use domain::Role;
|
||||
use server::{Config, create_user, run};
|
||||
use server::{Config, create_user, run, seed};
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(version, about = "Collection management system server")]
|
||||
@@ -20,6 +20,8 @@ enum Command {
|
||||
#[arg(long, value_enum)]
|
||||
role: RoleArg,
|
||||
},
|
||||
/// Seed the baseline Spectrum cataloguing vocabularies + field definitions (idempotent).
|
||||
Seed,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, ValueEnum)]
|
||||
@@ -50,5 +52,6 @@ async fn main() -> anyhow::Result<()> {
|
||||
Some(Command::CreateUser { email, role }) => {
|
||||
create_user(&cli.config.database_url, &email, role.into()).await
|
||||
}
|
||||
Some(Command::Seed) => seed(&cli.config.database_url).await,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user