@m1212e/rumble 0.12.8 → 0.12.9

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/out/index.js CHANGED
@@ -923,9 +923,9 @@ const createEnumImplementer = ({ db, schemaBuilder }) => {
923
923
  let enumSchemaName;
924
924
  let enumValues;
925
925
  if (tsName) {
926
- const schemaEnum = db._.schema[tsName];
926
+ const schemaEnum = db._.fullSchema[tsName];
927
927
  enumSchemaName = tsName.toString();
928
- const enumCol = Object.values(db._.schema).filter((s) => typeof s === "object").map((s) => Object.values(s.columns)).flat(2).find((s) => s.config?.enum === schemaEnum);
928
+ const enumCol = Object.values(db._.schema).filter((s) => typeof s === "object").map((s) => Object.values(s.columns)).flat(2).filter(isEnumSchema).find((e) => e.config.enum === schemaEnum);
929
929
  if (!enumCol) throw new RumbleError(`Could not find applied enum column for ${tsName.toString()}.
930
930
  Please ensure that you use the enum at least once as a column of a table!`);
931
931
  enumValues = enumCol.enumValues;