orchid-orm 1.50.4 → 1.50.5

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.
@@ -2276,7 +2276,8 @@ const report = (ast, config, currentSchema) => {
2276
2276
  }).join(", ")}` : ""}${indexes?.length ? indexes.length === 1 ? ", has index" : `, has ${indexes.length} indexes` : ""}${excludes?.length ? excludes.length === 1 ? ", has exclude" : `, has ${excludes.length} excludes` : ""}${checks?.length ? `, checks ${checks.map((check) => check.sql.toSQL({ values: [] })).join(", ")}` : ""}`
2277
2277
  );
2278
2278
  } else if (change.type === "change") {
2279
- const name = change.from.column?.data.name ?? key;
2279
+ let name = change.from.column?.data.name ?? key;
2280
+ if (config.snakeCase) name = orchidCore.toCamelCase(name);
2280
2281
  const changes2 = [];
2281
2282
  inner.push(`${yellow("~ change column")} ${name}:`, changes2);
2282
2283
  changes2.push(`${yellow("from")}: `);
@@ -2291,7 +2292,7 @@ const report = (ast, config, currentSchema) => {
2291
2292
  }
2292
2293
  } else if (change.type === "rename") {
2293
2294
  inner.push(
2294
- `${yellow("~ rename column")} ${key} ${yellow("=>")} ${change.name}`
2295
+ `${yellow("~ rename column")} ${config.snakeCase ? orchidCore.toCamelCase(key) : key} ${yellow("=>")} ${change.name}`
2295
2296
  );
2296
2297
  } else {
2297
2298
  rakeDb.exhaustive(change.type);
@@ -2944,7 +2945,7 @@ const appCodeGenUpdateDbFile = async (dbPath, tables, extensions, domains, curre
2944
2945
  if (extensions.length) {
2945
2946
  code += `
2946
2947
  extensions: [${extensions.map(
2947
- (ext) => ext.version ? `{ ${orchidCore.quoteObjectKey(ext.name)}: '${ext.version}' }` : orchidCore.singleQuote(ext.name)
2948
+ (ext) => ext.version ? `{ ${orchidCore.quoteObjectKey(ext.name, false)}: '${ext.version}' }` : orchidCore.singleQuote(ext.name)
2948
2949
  ).join(", ")}],`;
2949
2950
  }
2950
2951
  if (domains.length) {
@@ -2952,7 +2953,8 @@ const appCodeGenUpdateDbFile = async (dbPath, tables, extensions, domains, curre
2952
2953
  domains: {
2953
2954
  ${domains.sort((a, b) => a.name > b.name ? 1 : -1).map(
2954
2955
  (ast) => `${orchidCore.quoteObjectKey(
2955
- ast.schema ? `${ast.schema}.${ast.name}` : ast.name
2956
+ ast.schema ? `${ast.schema}.${ast.name}` : ast.name,
2957
+ false
2956
2958
  )}: (t) => ${ast.baseType.toCode(
2957
2959
  { t: "t", table: ast.name, currentSchema },
2958
2960
  ast.baseType.data.name ?? ""