Attempted fix for seed script

This commit is contained in:
jacob-buster 2025-09-24 13:20:25 -06:00
parent 86bcf6f00c
commit a94cb541a1
1 changed files with 7 additions and 0 deletions

View File

@ -40,6 +40,13 @@ async function upsertData(tx: any, tableName: string, table: any, data: any[]) {
if (!data || data.length === 0) return;
try {
// Fix YAML content in datasets table by converting literal \n to actual newlines
if (tableName === 'datasets') {
data = data.map(record => ({
...record,
ymlFile: record.ymlFile ? record.ymlFile.replace(/\\n/g, '\n') : record.ymlFile
}));
}
// For tables that should always use ON CONFLICT DO NOTHING instead of updating
const doNothingTables = [
'assetSearch',