Skip to content

Commit

Permalink
Bump version, add db migration close #207
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlynchRNA committed May 15, 2024
1 parent 5a42aa5 commit 3ad403e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webapp-next",
"version": "1.1.0",
"version": "1.2.0",
"description": "",
"main": "server.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ export default withRouter(function Layout(props) {
<div className={`transition-all duration-300 bg-white z-40 fixed w-screen h-screen overflow-hidden opacity-1 pointer-events-none ${switching===false?'opacity-0':''}`} />
<div className={`transition-all duration-300 bg-gray-900 z-50 fixed w-[280px] h-screen overflow-hidden opacity-1 pointer-events-none ${switching===false?'opacity-0':''}`} />
<footer className={`${showNavs ? 'lg:pl-72' : ''} mt-auto text-center text-gray-700 text-xs bg-white dark:bg-slate-900 dark:text-slate-400`}>
<div className='py-3'>© {new Date().getFullYear()} RNA Digital - v{packageJson.version}-{process.env.NEXT_PUBLIC_SHORT_COMMIT_HASH}</div>
<div className='py-3'>© {new Date().getFullYear()} RNA Digital - v{packageJson.version}{process.env.NEXT_PUBLIC_SHORT_COMMIT_HASH && `-git-${process.env.NEXT_PUBLIC_SHORT_COMMIT_HASH}`}</div>
</footer>
</>
);
Expand Down
34 changes: 34 additions & 0 deletions webapp/src/migrations/1.2.0.ts
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
},
});
}

0 comments on commit 3ad403e

Please sign in to comment.