Skip to content
Snippets Groups Projects
Commit 0b549b86 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

fix: migration script path

parent 687ce9e9
No related branches found
No related tags found
2 merge requests!96release V1.10.0,!62Dev
import { Db } from 'mongodb';
import { getDb } from '../migrations-utils/db';
import * as fs from 'fs';
// const fs = require('fs')
export const up = async () => {
const db: Db = await getDb();
fs.readFile('./src/migrations/data/newsletter-data.json', 'utf8', (err, jsonString) => {
if (err) {
console.error('File read failed:', err);
return;
}
const parsedData = JSON.parse(jsonString);
db.collection('newslettersubscriptions').insertMany(parsedData);
});
const data = fs.readFileSync('/app/src/migrations/data/newsletter-data.json', 'utf8');
const parsedData = JSON.parse(data);
db.collection('newslettersubscriptions').insertMany(parsedData);
};
export const down = async () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment