WatermelonDB
WatermelonDB copied to clipboard
How to disable create/update tracking
I have created_at and updated_at but I want to keep them as server values. How can I disable this automatic tracking that watermelon does?
I have the same issue, any answer on this?
I found a workaround, I don't know if it is practical or if it has any side effects.
export class User extends Model {
...
@field("_created_at")
created_at: string;
@field("_updated_at")
updated_at: string;
}
export const userSchema = tableSchema({
name: "users",
columns: [
...
{
name: "_created_at",
type: "string",
},
{
name: "_updated_at",
type: "string",
},
],
});
Yeah I just called mine server_created_at and server_updated_at
yup as long as it is not called "created_at" or "updated_at" it will not automatically track. Please close the issue if it is already fixed for you, thanks!