Move to monorepo for React Native!
This commit is contained in:
30
packages/backend/convex/schema.ts
Normal file
30
packages/backend/convex/schema.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { defineSchema, defineTable } from 'convex/server';
|
||||
import { v } from 'convex/values';
|
||||
import { authTables } from '@convex-dev/auth/server';
|
||||
|
||||
// The schema is normally optional, but Convex Auth
|
||||
// requires indexes defined on `authTables`.
|
||||
// The schema provides more precise TypeScript types.
|
||||
export default defineSchema({
|
||||
...authTables,
|
||||
users: defineTable({
|
||||
name: v.optional(v.string()),
|
||||
image: v.optional(v.string()),
|
||||
email: v.optional(v.string()),
|
||||
currentStatusId: v.optional(v.id('statuses')),
|
||||
emailVerificationTime: v.optional(v.number()),
|
||||
phone: v.optional(v.string()),
|
||||
phoneVerificationTime: v.optional(v.number()),
|
||||
isAnonymous: v.optional(v.boolean()),
|
||||
})
|
||||
.index('email', ['email'])
|
||||
.index('phone', ['phone']),
|
||||
statuses: defineTable({
|
||||
userId: v.id('users'),
|
||||
message: v.string(),
|
||||
updatedAt: v.number(),
|
||||
updatedBy: v.optional(v.id('users')),
|
||||
})
|
||||
.index('by_user', ['userId'])
|
||||
.index('by_user_updatedAt', ['userId', 'updatedAt']),
|
||||
});
|
Reference in New Issue
Block a user