@gzl10/nexus-backend 0.16.4 → 0.16.6

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.
package/dist/cli.js CHANGED
@@ -963,7 +963,7 @@ function prefixPluginTables(code, modules) {
963
963
  const fields = def.fields;
964
964
  if (!fields) continue;
965
965
  for (const field of Object.values(fields)) {
966
- const relation = field?.db?.relation;
966
+ const relation = field?.relation;
967
967
  if (!relation?.table) continue;
968
968
  if (pluginTables.has(relation.table)) {
969
969
  relation.table = `${prefix}${relation.table}`;
@@ -22608,9 +22608,10 @@ async function readPostgreSQLSchema(knex3) {
22608
22608
  );
22609
22609
  const idxRows = idxResult.rows || [];
22610
22610
  for (const idx of idxRows) {
22611
+ const cols = Array.isArray(idx.column_names) ? idx.column_names : typeof idx.column_names === "string" ? idx.column_names.replace(/^\{|\}$/g, "").split(",").filter(Boolean) : [];
22611
22612
  indexes.push({
22612
22613
  name: idx.index_name,
22613
- columns: idx.column_names,
22614
+ columns: cols,
22614
22615
  unique: idx.is_unique
22615
22616
  });
22616
22617
  }