11import { LaunchQLProject } from '../class/launchql' ;
2- import { deploy } from '../sqitch /deploy' ;
3- import { revert } from '../sqitch /revert' ;
4- import { verify } from '../sqitch /verify' ;
2+ import { deployProject } from '../projects /deploy-project ' ;
3+ import { revertProject } from '../projects /revert-project ' ;
4+ import { verifyProject } from '../projects /verify-project ' ;
55import { getEnvOptions } from '@launchql/types' ;
66import { getPgEnvOptions } from 'pg-env' ;
77import { Logger } from '@launchql/logger' ;
8- import { deployCommand } from '../migrate/ deploy-command ' ;
9- import { revertCommand } from '../migrate/ revert-command ' ;
10- import { verifyCommand } from '../migrate/ verify-command ' ;
8+ import { deployModule } from './ deploy-module ' ;
9+ import { revertModule } from './ revert-module ' ;
10+ import { verifyModule } from './ verify-module ' ;
1111import { runSqitch } from '../utils/sqitch-wrapper' ;
1212
1313const log = new Logger ( 'project-commands' ) ;
@@ -20,12 +20,16 @@ export interface MigrationOptions {
2020 useSqitch ?: boolean ;
2121 useTransaction ?: boolean ;
2222 toChange ?: string ;
23+ // Options for fast deployment
24+ fast ?: boolean ;
25+ usePlan ?: boolean ;
26+ cache ?: boolean ;
2327}
2428
2529/**
2630 * Deploy a project - handles both recursive (multi-module) and non-recursive (single directory) deployments
2731 */
28- export async function deployWithOptions ( options : MigrationOptions ) : Promise < void > {
32+ export async function deployModules ( options : MigrationOptions ) : Promise < void > {
2933 if ( options . recursive ) {
3034 if ( ! options . projectName ) {
3135 throw new Error ( 'projectName is required when recursive is true' ) ;
@@ -42,22 +46,25 @@ export async function deployWithOptions(options: MigrationOptions): Promise<void
4246 const modulePath = modules [ options . projectName ] . path ;
4347 log . info ( `Deploying project ${ options . projectName } from ${ modulePath } to database ${ options . database } ...` ) ;
4448
45- await deploy (
49+ await deployProject (
4650 getEnvOptions ( { pg : { database : options . database } } ) ,
4751 options . projectName ,
4852 options . database ,
4953 modulePath ,
5054 {
5155 useSqitch : options . useSqitch ,
52- useTransaction : options . useTransaction
56+ useTransaction : options . useTransaction ,
57+ fast : options . fast ,
58+ usePlan : options . usePlan ,
59+ cache : options . cache
5360 }
5461 ) ;
5562 } else {
5663 // Direct execution on current directory
5764 if ( options . useSqitch ) {
5865 await runSqitch ( 'deploy' , options . database , options . cwd ) ;
5966 } else {
60- await deployCommand (
67+ await deployModule (
6168 getPgEnvOptions ( ) ,
6269 options . database ,
6370 options . cwd ,
@@ -73,7 +80,7 @@ export async function deployWithOptions(options: MigrationOptions): Promise<void
7380/**
7481 * Revert a project - handles both recursive (multi-module) and non-recursive (single directory) reverts
7582 */
76- export async function revertWithOptions ( options : MigrationOptions ) : Promise < void > {
83+ export async function revertModules ( options : MigrationOptions ) : Promise < void > {
7784 if ( options . recursive ) {
7885 if ( ! options . projectName ) {
7986 throw new Error ( 'projectName is required when recursive is true' ) ;
@@ -89,7 +96,7 @@ export async function revertWithOptions(options: MigrationOptions): Promise<void
8996
9097 log . info ( `Reverting project ${ options . projectName } on database ${ options . database } ...` ) ;
9198
92- await revert (
99+ await revertProject (
93100 getEnvOptions ( { pg : { database : options . database } } ) ,
94101 options . projectName ,
95102 options . database ,
@@ -104,7 +111,7 @@ export async function revertWithOptions(options: MigrationOptions): Promise<void
104111 if ( options . useSqitch ) {
105112 await runSqitch ( 'revert' , options . database , options . cwd ) ;
106113 } else {
107- await revertCommand (
114+ await revertModule (
108115 getPgEnvOptions ( ) ,
109116 options . database ,
110117 options . cwd ,
@@ -120,7 +127,7 @@ export async function revertWithOptions(options: MigrationOptions): Promise<void
120127/**
121128 * Verify a project - handles both recursive (multi-module) and non-recursive (single directory) verification
122129 */
123- export async function verifyWithOptions ( options : MigrationOptions ) : Promise < void > {
130+ export async function verifyModules ( options : MigrationOptions ) : Promise < void > {
124131 if ( options . recursive ) {
125132 if ( ! options . projectName ) {
126133 throw new Error ( 'projectName is required when recursive is true' ) ;
@@ -136,7 +143,7 @@ export async function verifyWithOptions(options: MigrationOptions): Promise<void
136143
137144 log . info ( `Verifying project ${ options . projectName } on database ${ options . database } ...` ) ;
138145
139- await verify (
146+ await verifyProject (
140147 getEnvOptions ( { pg : { database : options . database } } ) ,
141148 options . projectName ,
142149 options . database ,
@@ -148,7 +155,7 @@ export async function verifyWithOptions(options: MigrationOptions): Promise<void
148155 if ( options . useSqitch ) {
149156 await runSqitch ( 'verify' , options . database , options . cwd ) ;
150157 } else {
151- await verifyCommand (
158+ await verifyModule (
152159 getPgEnvOptions ( ) ,
153160 options . database ,
154161 options . cwd
0 commit comments