admin migrate-database
This commit is contained in:
@@ -10,6 +10,7 @@ use crate::auth::capability_sets::{
|
||||
use crate::auth::jwt::{AccessTokenContext, JwtService, PrincipalKind};
|
||||
use crate::config::AppConfig;
|
||||
use crate::db::{self, PgPool};
|
||||
use crate::migrations::MIGRATIONS;
|
||||
use crate::models::{
|
||||
Job, NewUser, NewUserMembership, NewUserPasskey, NewUserSession, Tenant, TenantStatus, User,
|
||||
UserMembership,
|
||||
@@ -28,7 +29,7 @@ use diesel::connection::SimpleConnection;
|
||||
use diesel::prelude::*;
|
||||
use diesel::OptionalExtension;
|
||||
use diesel::PgConnection;
|
||||
use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness};
|
||||
use diesel_migrations::MigrationHarness;
|
||||
use http_body_util::BodyExt;
|
||||
use once_cell::sync::Lazy;
|
||||
use rand::{rngs::OsRng, TryRngCore};
|
||||
@@ -39,7 +40,6 @@ use tokio::sync::Mutex;
|
||||
use tower::util::ServiceExt;
|
||||
use uuid::Uuid;
|
||||
|
||||
const MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations");
|
||||
const RESET_DATABASE_SQL: &str = "DROP SCHEMA IF EXISTS tenant CASCADE;\n\
|
||||
DROP SCHEMA IF EXISTS shared CASCADE;\n\
|
||||
DROP SCHEMA IF EXISTS public CASCADE;\n\
|
||||
@@ -170,6 +170,7 @@ impl TestApp {
|
||||
|
||||
let mut config = AppConfig {
|
||||
database_url: database_url.clone(),
|
||||
migrations_database_url: None,
|
||||
database_max_pool_size: db::DEFAULT_MAX_POOL_SIZE,
|
||||
server_host: "127.0.0.1".to_string(),
|
||||
server_port: 0,
|
||||
|
||||
Reference in New Issue
Block a user