mutano 3.0.11 → 3.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.js +2 -1
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -606,7 +606,8 @@ function generateKyselyContent({
606
606
  let fieldType = getType("table", desc, config, destination);
607
607
  const isAutoIncrement = desc.Extra.toLowerCase().includes("auto_increment");
608
608
  const isDefaultGenerated = desc.Extra.toLowerCase().includes("default_generated");
609
- if (isAutoIncrement || isDefaultGenerated) {
609
+ const hasExplicitDefault = desc.Default !== null && !isAutoIncrement && !isDefaultGenerated;
610
+ if (isAutoIncrement || isDefaultGenerated || hasExplicitDefault) {
610
611
  fieldType = `Generated<${fieldType.replace(" | null", "")}>${fieldType.includes(" | null") ? " | null" : ""}`;
611
612
  }
612
613
  content += ` ${fieldName}: ${fieldType};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mutano",
3
3
  "type": "module",
4
- "version": "3.0.11",
4
+ "version": "3.0.12",
5
5
  "description": "Converts Prisma/MySQL/PostgreSQL/SQLite schemas to Zod/TS/Kysely interfaces",
6
6
  "author": "Alisson Cavalcante Agiani <thelinuxlich@gmail.com>",
7
7
  "license": "MIT",