Centralize durable schema migration ownership

This commit is contained in:
ms2k 2026-07-19 01:20:18 +09:00
commit 069f3813ae

View file

@ -12,8 +12,6 @@ use time::OffsetDateTime;
use crate::WorkerError;
const MIGRATION_TABLE: &str = "_remora_worker_migrations";
#[derive(Clone)]
pub struct DescriptorStore {
pool: PgPool,
@ -154,17 +152,6 @@ impl DescriptorStore {
}
}
pub async fn migrate(pool: &PgPool) -> Result<(), sqlx::migrate::MigrateError> {
migrator().run(pool).await
}
#[must_use]
pub fn migrator() -> sqlx::migrate::Migrator {
let mut migrator = sqlx::migrate!("./migrations");
migrator.dangerous_set_table_name(MIGRATION_TABLE);
migrator
}
struct StoredDescriptor {
id: OpaqueId,
schema_version: PositiveIntegerDto,