Merge pull request #1118 from buster-so/jacob-bus-1922-dbinit-seed-script-is-broken

Attempted fix for seed script
This commit is contained in:
dal 2025-09-24 13:26:38 -06:00 committed by GitHub
commit a538afe3dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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; if (!data || data.length === 0) return;
try { 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 // For tables that should always use ON CONFLICT DO NOTHING instead of updating
const doNothingTables = [ const doNothingTables = [
'assetSearch', 'assetSearch',