Anselm Schüler

Results 94 comments of Anselm Schüler

This is likely because you have not specified a type for `id`. Try this instead: ```ts /* … */ id: { ...DataTypes.string(36), primaryKey: true }, /* … */ ```

That code uses ES spread syntax. If you don’t want to use that, do this: ```ts /* … */ id: { type: DataTypes.STRING, length: 36, primaryKey: true }, /* …...

As far as I can tell, the documentation also seems to describe putting defaults in their own static field, like this: ```ts /* … */ static defaults = { id:...

Note that it is likely not a good idea to specify a default ID. While your code may look like it generates a random UUID for every entry, it actually...

> bump @chovyprognos That’s not how GH issues work

This seems like 100% intended behaviour. JS functions are not a datatype supported by any SQL database, so the value is coerced (likely to a string). The database then rejects...

We could also just add a check in the creation logic that executes a function if it is a function (checked with `typeof default === "function"`).

This seems more of a feature request to me. Or is this already supported and your error was hypothetical?

> The error appears when the db engine tries to create the tables. It seems like a bug. @stillalivx But that error would be expected if the functionality of running...

After all, the error is pretty clear—the value was invalid. A function is an invalid value.