@m1212e/rumble 0.12.7 → 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.cjs CHANGED
@@ -965,9 +965,9 @@ const createEnumImplementer = ({ db, schemaBuilder }) => {
965
965
  let enumSchemaName;
966
966
  let enumValues;
967
967
  if (tsName) {
968
- const schemaEnum = db._.schema[tsName];
968
+ const schemaEnum = db._.fullSchema[tsName];
969
969
  enumSchemaName = tsName.toString();
970
- 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);
970
+ 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);
971
971
  if (!enumCol) throw new RumbleError(`Could not find applied enum column for ${tsName.toString()}.
972
972
  Please ensure that you use the enum at least once as a column of a table!`);
973
973
  enumValues = enumCol.enumValues;