Skip to content

Conversation

@raideno
Copy link

@raideno raideno commented Nov 2, 2025

Extract users table into an object of its own, this makes it easier for users to extend the table if they need to.

Allow us to do:

import { usersTable, authTables } from '@convex-dev/auth/server'
import { stripeTables } from '@raideno/convex-stripe/server'
import { defineSchema, defineTable } from 'convex/server'
import { v } from 'convex/values'

export default defineSchema({
  ...authTables,
  ...stripeTables,
  users: defineTable({
    ...usersTable,
    myNewField: v.optional(v.string()),
  }),
});

Instead of

import { authTables } from '@convex-dev/auth/server'
import { stripeTables } from '@raideno/convex-stripe/server'
import { defineSchema, defineTable } from 'convex/server'
import { v } from 'convex/values'

export default defineSchema({
  ...authTables,
  ...stripeTables,
  users: defineTable({
    name: v.optional(v.string()),
    image: v.optional(v.string()),
    email: v.optional(v.string()),
    emailVerificationTime: v.optional(v.number()),
    phone: v.optional(v.string()),
    phoneVerificationTime: v.optional(v.number()),
    isAnonymous: v.optional(v.boolean()),
    // ...authTables.users,
    myNewField: v.optional(v.string()),
  }),
});

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Extract users table into an object of its own, this makes it easier for users to extend the table if they need to.
@vercel
Copy link

vercel bot commented Nov 2, 2025

@raideno is attempting to deploy a commit to the Convex Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant