-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump version, add db migration close #207
- Loading branch information
1 parent
5a42aa5
commit 3ad403e
Showing
3 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import debug from 'debug'; | ||
const log = debug('webapp:migration:1.2.0'); | ||
|
||
export default async function(db) { | ||
log('Updating apps collection with new properties'); | ||
await db.collection('apps').updateMany({}, { | ||
$set: { | ||
memory: false, | ||
cache: false, | ||
}, | ||
}); | ||
log('Updating datasource collection with new properties'); | ||
await db.collection('apps').updateMany({}, { | ||
$set: { | ||
recordCount: {}, | ||
}, | ||
$unset: { | ||
syncedCount: '', | ||
embeddedCount: '', | ||
} | ||
}); | ||
|
||
log('Making all non builtin tasks require human input'); | ||
//NOTE: we don't use libs here e.g. SubscriptionPlan.RAW because that struct could change/not be importable anymore. all has to be encapsulated | ||
await db.collection('apps').updateMany({ | ||
'data.builtin': false | ||
}, { | ||
$set: { | ||
requiresHumanInput: true, | ||
retriever_type: 'raw', | ||
retriever_config: {}, //not required for raw | ||
}, | ||
}); | ||
} |