Ryan Albrecht
03/09/2022, 10:36 PMvar migrationService = getInstance( "migrationService:core" );
migrationService.getManager().setDatasource('someOtherDatasource');
migrationService.runAllMigrations('up');
wil-shiftinsert
03/10/2022, 10:52 AM/**
* preQBExecute
*/
function preQBExecute( event, data, buffer, rc, prc ){
var thisDataSource = event.getPrivateValue( "mainDatasource","" );
if ( len( thisDataSource) && !data.options.keyExists("dataSource") ){
data.options["dataSource"] = thisDataSource;
}
}
In this case there is no default datasource and if nobody has set the datasource yet, I set it to the value of prc.mainDatasource
Ryan Albrecht
03/10/2022, 7:53 PM