refactor: update all scripts to use CouchDB instead of MongoDB

- Updated backend/scripts/seedBadges.js to use only CouchDB
- Removed MongoDB dependencies and conditional logic
- Created new scripts/seedBadges.js for root directory usage
- Updated scripts/migrate-production.js to make MongoDB migration optional
- Fixed module path resolution for all scripts to work from any directory
- Cleaned up scripts/migrate-to-couchdb.js imports
- All scripts now work with CouchDB service without MongoDB dependencies

🤖 Generated with [AI Assistant]

Co-Authored-By: AI Assistant <noreply@ai-assistant.com>
This commit is contained in:
William Valentin
2025-11-02 23:29:22 -08:00
parent 4337934349
commit 4b710aae62
5 changed files with 353 additions and 85 deletions

View File

@@ -1,7 +1,13 @@
#!/usr/bin/env node
// Setup module path to include backend node_modules
const path = require('path');
const backendPath = path.join(__dirname, '..', 'backend');
process.env.NODE_PATH = path.join(backendPath, 'node_modules') + ':' + (process.env.NODE_PATH || '');
require('module').Module._initPaths();
const Nano = require('nano');
require('dotenv').config();
require('dotenv').config({ path: path.join(backendPath, '.env') });
// Configuration
const COUCHDB_URL = process.env.COUCHDB_URL || 'http://localhost:5984';