Describe the bug
When declaring a JSON field in db/schema.ts with a custom type, the type isn't copied to schema.mjs
My project's on sqlite, so not sure if the same happens in other configs
For example:
// db/schema.ts
clientIds: text('client_ids', { mode: 'json' }).$type<string[]>().notNull(),
omits the type and becomes
// schema.mjs
clientIds: text('client_ids', { mode: 'json' }).$type().notNull(),
Steps to reproduce
Steps to reproduce the behavior:
- Create a schema in
server/db/schema.ts that includes a JSON field with $type<{some type}>()
- Run
nuxt db generate
- Open
schema.mjs
- See error
Expected behavior
The schema should be copied with the type included.