Disallow null values on TeamMember
It is currently possible to insert null
values on the team_id
and the user_id
columns of the team_members
table.
To replicate the issue, try writing a query along the lines of:
await TeamMember.query().insert({
teamId: undefined,
userId: undefined,
})
It is unclear to me why undefined
passes the schema validation (the same insertion with null
instead doesn't).
There is however, no check on the sql level (eg. NOT NULL
) to guarantee no wrong db data.