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:
@@ -1,8 +1,13 @@
|
||||
// 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 mongoose = require('mongoose');
|
||||
const { MongoClient } = require('mongodb');
|
||||
const Nano = require('nano');
|
||||
|
||||
// MongoDB models
|
||||
// MongoDB models (only needed for migration)
|
||||
const User = require('../backend/models/User');
|
||||
const Street = require('../backend/models/Street');
|
||||
const Task = require('../backend/models/Task');
|
||||
|
||||
Reference in New Issue
Block a user