|
@@ -35,15 +35,13 @@ export class BulkInserter {
|
|
|
// Map the row data to match Prisma model field names
|
|
// Map the row data to match Prisma model field names
|
|
|
Object.keys(row).forEach(key => {
|
|
Object.keys(row).forEach(key => {
|
|
|
// Convert snake_case to camelCase for Prisma model compatibility
|
|
// Convert snake_case to camelCase for Prisma model compatibility
|
|
|
- const camelKey = key.replace(/_([a-z])/g, (g) => g[1].toUpperCase());
|
|
|
|
|
|
|
+ const camelKey = key.replace(/_([a-z0-9])/g, (g) => g[1].toUpperCase());
|
|
|
mappedRow[camelKey] = row[key];
|
|
mappedRow[camelKey] = row[key];
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
return mappedRow;
|
|
return mappedRow;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- console.log(batch)
|
|
|
|
|
- console.log(values);
|
|
|
|
|
// Use appropriate Prisma model based on table name
|
|
// Use appropriate Prisma model based on table name
|
|
|
if (tableName === 'cintas_install_calendar') {
|
|
if (tableName === 'cintas_install_calendar') {
|
|
|
await this.prisma.cintasInstallCalendar.createMany({
|
|
await this.prisma.cintasInstallCalendar.createMany({
|