Papa JohnsP
Convex Community16mo ago
2 replies
Papa Johns

Default values for fields

export default defineSchema({
  users: defineTable({
    firstName: v.string(),
    lastName: v.string(),
    email: v.string(),
    isEmailVerified: v.string(),
    clerkUserId: v.string(),
    isActive: v.boolean(),
    isDeleted: v.boolean(),
    createdAt: v.string(),
    updatedAt: v.string(),
  })
    .index("by_clerk_user_id", ["clerkUserId"])
    .index("by_email", ["email"])
    .index("by_created_at", ["createdAt"]),
});


I have this schema for my clerk authenticated user. I want to keep some default values like isActive, isDeleted, createdAt and updatedAt. Any suggestions how can I use that.
Was this page helpful?