orchid-orm 1.58.9 → 1.58.10

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.
@@ -26,7 +26,6 @@ const compareSqlExpressions = async (tableExpressions, adapter) => {
26
26
  const result = await adapter.query(combinedQueries, values, viewName).then(
27
27
  (res) => res[1],
28
28
  async (err) => {
29
- await adapter.query(`ROLLBACK TO SAVEPOINT "${viewName}"`);
30
29
  if (err.code !== "42704") {
31
30
  throw err;
32
31
  }
@@ -1996,13 +1995,10 @@ const applyChangeTables = async (adapter, changeTables, structureToAstCtx, dbStr
1996
1995
  }
1997
1996
  };
1998
1997
  const getColumnDbTypeForComparison = (column, currentSchema) => {
1999
- if (column instanceof pqb.EnumColumn) {
2000
- return "text";
2001
- }
2002
1998
  if (column instanceof pqb.ArrayColumn) {
2003
1999
  return getColumnDbTypeForComparison(column.data.item, currentSchema) + "[]".repeat(column.data.arrayDims);
2004
2000
  }
2005
- let type = column.dataType;
2001
+ let type = column instanceof pqb.EnumColumn ? column.enumName : column.dataType;
2006
2002
  const i = type.indexOf("(");
2007
2003
  let append = "";
2008
2004
  if (i !== -1) {
@@ -2012,7 +2008,9 @@ const getColumnDbTypeForComparison = (column, currentSchema) => {
2012
2008
  const j = type.indexOf(".");
2013
2009
  if (j === -1) {
2014
2010
  let result = `"${type}"${append}`;
2015
- if (column.data.isOfCustomType) result = `"${currentSchema}".${result}`;
2011
+ if (column.data.isOfCustomType || column instanceof pqb.EnumColumn) {
2012
+ result = `"${currentSchema}".${result}`;
2013
+ }
2016
2014
  return result;
2017
2015
  } else {
2018
2016
  return `"${type.slice(j)}"."${type.slice(0, j)}"${append}`;