lookinlab/adonis-lucid-soft-deletes

ERROR

Closed this issue · 2 comments

A 'deletedAt' property on type 'User' cannot be assigned to the same property on base type 'LucidRow & { $forceDelete: boolean; DeletedIn: DateTime | null; read-only discarded: boolean; $getQueryFor(action: "insert", client: QueryClientContract): InsertQueryBuilderContract<...>; $getQueryFor(action: "update" | ... 1 more ... | "update", client: QueryClientContract): ModelQueryBuilderContract<...>; delete(): ...'.

Any ideas on how to get around this problem? I'm using Adonis 5

@wallysonn remove ? for column deletedAt:

Before:

@column.dateTime({ columnName: 'customDeletedAtColumn' })
public deletedAt?: DateTime | null

After:

@column.dateTime({ columnName: 'customDeletedAtColumn' })
public deletedAt: DateTime | null

You don't have to add this block, it is intended for cases when you need to set a custom name from the database for the deletedAt column