notiz-dev / prisma-dbml-generator

Prisma DBML Generator
MIT License
684 stars 37 forks source link

Use dbName for field when mapToDbSchema option is true #56

Open mjaquard opened 2 months ago

mjaquard commented 2 months ago

In line 91 of table.ts, replace :

      return `  ${field.name} ${fieldType}${generateColumnDefinition(field)}`;

by

      return `  ${mapToDbSchema && field.dbName ? field.dbName : field.name} ${fieldType}${generateColumnDefinition(field)}`;