mirror of https://github.com/buster-so/buster.git
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:
commit
a538afe3dd
|
@ -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',
|
||||||
|
|
Loading…
Reference in New Issue