mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-23 07:42:10 +00:00
Set init scripts collection to "globalconfigs"
This commit is contained in:
parent
b99605a04e
commit
64f96ca039
@ -2,7 +2,7 @@ const PKG_VERSION = require('../package.json').version;
|
||||
const { update } = require('../util/db');
|
||||
|
||||
async function run() {
|
||||
const collection = 'GlobalConfig';
|
||||
const collection = 'globalconfigs';
|
||||
const name = 'version';
|
||||
await update(collection, { name }, { value: PKG_VERSION });
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ async function run() {
|
||||
}
|
||||
|
||||
async function updateVersion() {
|
||||
const collection = 'GlobalConfig';
|
||||
const collection = 'globalconfigs';
|
||||
const name = 'version';
|
||||
const docs = await find(collection, { name });
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* eslint-disable no-undef */
|
||||
|
||||
const url = process.env['MONGO_URL'] || 'mongodb://localhost/fyipedb';
|
||||
const collection = 'GlobalConfig';
|
||||
const collection = 'globalconfigs';
|
||||
|
||||
const {
|
||||
collectionObject,
|
||||
|
@ -8,11 +8,11 @@ const update = jest.spyOn(util, 'update');
|
||||
|
||||
const end = require('../scripts/end');
|
||||
|
||||
test('Should update GlobalConfig record with name "version" to package version', async () => {
|
||||
test('Should update globalconfigs record with name "version" to package version', async () => {
|
||||
mockDbCollection();
|
||||
await end();
|
||||
expect(update).toBeCalledWith(
|
||||
'GlobalConfig',
|
||||
'globalconfigs',
|
||||
{ name: 'version' },
|
||||
{ value: PKG_VERSION }
|
||||
);
|
||||
|
@ -9,16 +9,16 @@ const save = jest.spyOn(util, 'save');
|
||||
|
||||
const start = require('../scripts/start');
|
||||
|
||||
test('Should query GlobalConfig for record with name "version"', async () => {
|
||||
test('Should query globalconfigs for record with name "version"', async () => {
|
||||
mockDbCollection(true);
|
||||
await start();
|
||||
expect(find).toBeCalledWith('GlobalConfig', { name: 'version' });
|
||||
expect(find).toBeCalledWith('globalconfigs', { name: 'version' });
|
||||
});
|
||||
|
||||
test('Should save record to GlobalConfig if no records are found', async () => {
|
||||
test('Should save record to globalconfigs if no records are found', async () => {
|
||||
mockDbCollection();
|
||||
await start();
|
||||
expect(save).toBeCalledWith('GlobalConfig', [
|
||||
expect(save).toBeCalledWith('globalconfigs', [
|
||||
{
|
||||
name: 'version',
|
||||
value: PKG_VERSION,
|
||||
|
Loading…
Reference in New Issue
Block a user