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