Skip to content

Commit

Permalink
clean relicts from mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
leider committed Jun 2, 2024
1 parent e4f97f0 commit b9de668
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 282 deletions.
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
.idea/workspace.xml
*.iml

.vagrant

*.log

node_modules/
Expand All @@ -22,10 +20,6 @@ config/*.json*
!config/testbeans.json
!config/testbeansWithDB.json

dev-goodies
!dev-goodies/icon_WebStorm.png
!dev-goodies/mongo snippets.txt

**/build
**/*coverage*
**/fixtures/*.html
Expand All @@ -46,5 +40,9 @@ docker/mongo/
/softwerkskammer/chado-result.json
/.idea/shelf
/2023-12-24
/2024-06-01
/.idea/prettier.xml
/mongoimport_agora.sh
/backups/
*.gz
db/*
3 changes: 3 additions & 0 deletions backup-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

node ./backup-sqlite.js ../backups
3 changes: 0 additions & 3 deletions config-examples/mongo-config.json

This file was deleted.

81 changes: 0 additions & 81 deletions dev-goodies/mongo snippets.txt

This file was deleted.

3 changes: 0 additions & 3 deletions migrateToSQLite.sh

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"luxon": "3.4.4",
"marked": "12.0.2",
"mime-types": "2.1.35",
"mongodb": "6.5.0",
"morgan": "1.10.0",
"multiparty": "4.2.3",
"node-syntaxhighlighter": "0.8.1",
Expand Down
2 changes: 0 additions & 2 deletions softwerkskammer/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ function createConfiguration() {

// then, add properties from config files:
const files = [
"mongo-config.json",
"server-config.json",
"authentication-config.json",
"mailsender-config.json",
"wikirepo-config.json",
"activityresults-config.json",
"socrates-config.json",
];
conf.addFiles(files.map((file) => configdir + file));

Expand Down
62 changes: 0 additions & 62 deletions softwerkskammer/lib/migrateToSqlite/migrateAllFromMongo.js

This file was deleted.

12 changes: 8 additions & 4 deletions softwerkskammer/lib/persistence/sqlitePersistence.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ function execWithTry(command) {

module.exports = function sqlitePersistenceFunc(collectionName, extraColumns) {
const extraCols = extraColumns ? extraColumns.split(",") : [];
function create() {

function createForTest() {
const columns = ["id TEXT PRIMARY KEY", "data BLOB"].concat(
extraCols.map((col) => {
if (col === "version") {
Expand All @@ -61,7 +62,6 @@ module.exports = function sqlitePersistenceFunc(collectionName, extraColumns) {
}
}

create();
const colsForSave = ["id", "data"].concat(extraCols);

const persistence = {
Expand Down Expand Up @@ -171,8 +171,12 @@ module.exports = function sqlitePersistenceFunc(collectionName, extraColumns) {
},

recreateForTest() {
db.exec(`DROP TABLE IF EXISTS ${collectionName};`);
create();
if (collectionName === "teststore") {
db.exec(`DROP TABLE IF EXISTS ${collectionName};`);
createForTest();
} else {
console.error("Trying to drop a production collection?"); // eslint-disable-line no-console
}
},
};
return persistence;
Expand Down
Loading

0 comments on commit b9de668

Please sign in to comment.