@@ -39,6 +39,7 @@ function fieldsToDesignDocs(
3939
4040const transactionIndexes : DesignDocumentMap = {
4141 ...fieldsToDesignDocs ( [ 'isoDate' ] ) ,
42+ ...fieldsToDesignDocs ( [ 'orderId' ] ) ,
4243 ...fieldsToDesignDocs ( [ 'status' ] ) ,
4344 ...fieldsToDesignDocs ( [ 'status' , 'depositCurrency' , 'isoDate' ] ) ,
4445 ...fieldsToDesignDocs ( [
@@ -125,20 +126,14 @@ const options: SetupDatabaseOptions = {
125126}
126127
127128export async function initDbs ( ) : Promise < void > {
128- if ( config . couchUris != null ) {
129- const pool = connectCouch ( config . couchMainCluster , config . couchUris )
130- await setupDatabase ( pool , couchSettingsSetup , options )
131- await Promise . all (
132- databases . map ( async setup => await setupDatabase ( pool , setup , options ) )
133- )
134- } else {
135- await Promise . all (
136- databases . map (
137- async setup =>
138- await setupDatabase ( config . couchDbFullpath , setup , options )
139- )
140- )
129+ if ( config . couchUris == null ) {
130+ throw new Error ( 'couchUris is not set' )
141131 }
132+ const pool = connectCouch ( config . couchMainCluster , config . couchUris )
133+ await setupDatabase ( pool , couchSettingsSetup , options )
134+ await Promise . all (
135+ databases . map ( async setup => await setupDatabase ( pool , setup , options ) )
136+ )
142137 console . log ( 'Done' )
143138 process . exit ( 0 )
144139}
0 commit comments