/** * Applies IR-diff migration plans via Prisma Migrate or Drizzle/SQL execution. * * Prisma: write `migration.sql` under a migrate folder, then `prisma migrate deploy`. * Drizzle: write SQL artifact, then apply against DATABASE_URL (pg), matching db-init. */ export type MigrationTool = 'prisma' | 'drizzle'; export interface MigrationArtifactPlan { sql: string[]; prisma: string[]; summary: string[]; } export interface CommandResult { code: number; stdout: string; stderr: string; } export type CommandRunner = (command: string, args: readonly string[], options: { cwd: string; env: NodeJS.ProcessEnv; }) => Promise; export type SqlApplier = (sql: string, databaseUrl: string) => Promise; export interface MigrationToolRunnerDeps { writeFile?: (filePath: string, body: string) => Promise; mkdir?: (dir: string) => Promise; runCommand?: CommandRunner; applySql?: SqlApplier; now?: () => Date; env?: NodeJS.ProcessEnv; } export interface ApplyMigrationOptions { tool: MigrationTool; cwd: string; migrationsDir: string; databaseUrl?: string; /** When true, write artifacts but skip tool/SQL execution. */ dryRun?: boolean; } export interface ApplyMigrationResult { migrationDir: string; sqlPath: string; prismaNotesPath: string | null; command?: CommandResult; appliedVia: 'prisma-migrate-deploy' | 'sql-database-url' | 'dry-run'; } export declare class MigrationToolRunner { private readonly writeFile; private readonly mkdir; private readonly runCommand; private readonly applySql; private readonly now; private readonly env; constructor(deps?: MigrationToolRunnerDeps); apply(plan: MigrationArtifactPlan, options: ApplyMigrationOptions): Promise; } //# sourceMappingURL=migrate-tool-runner.d.ts.map