Skip to content

Commit

Permalink
migration testest
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihajlo-Pavlovic committed Dec 18, 2024
1 parent 86b32da commit 703a3c0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
26 changes: 17 additions & 9 deletions src/migration/TripleStoreUserConfigurationMigration.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,24 @@ class TripleStoreUserConfigurationMigration extends BaseMigration {

const userConfiguration = await this.fileService.readFile(configurationFilePath, true);

if ('tripleStore' in userConfiguration) {
if ('tripleStore' in userConfiguration.modules) {
const oldConfigTripleStore = userConfiguration.modules;
const implementation = oldConfigTripleStore.implementation[0];
const { url, username, password } = implementation.config.repositories.publicCurrent;
implementation.config.repositories.dkg = {
url,
name: 'dkg',
username,
password,
};
for (const implementation in oldConfigTripleStore.tripleStore.implementation) {
if (oldConfigTripleStore.tripleStore.implementation[implementation].enabled) {
const { url, username, password } =
oldConfigTripleStore.tripleStore.implementation[implementation].config
.repositories.publicCurrent;

oldConfigTripleStore.tripleStore.implementation[
implementation
].config.repositories.dkg = {
url,
name: 'dkg',
username,
password,
};
}
}

await this.fileService.writeContentsToFile(
configurationFolderPath,
Expand Down
2 changes: 1 addition & 1 deletion src/migration/migration-executor.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';

import { NODE_ENVIRONMENTS } from '../constants/constants.js';
import TripleStoreUserConfigurationMigration from './TripleStoreUserConfigurationMigration';
import TripleStoreUserConfigurationMigration from './TripleStoreUserConfigurationMigration.js';

class MigrationExecutor {
static async executeTripleStoreUserConfigurationMigration(container, logger, config) {
Expand Down

0 comments on commit 703a3c0

Please sign in to comment.