@convex-dev/better-auth 0.8.0-alpha.6 → 0.8.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -165,6 +165,22 @@ const schema = defineSchema({
165
165
  })
166
166
  .index("clientId_userId", ["clientId","userId"]),
167
167
 
168
+ team: defineTable({
169
+ name: v.string(),
170
+ organizationId: v.string(),
171
+ createdAt: v.number(),
172
+ updatedAt: v.optional(v.union(v.null(), v.number())),
173
+ })
174
+ .index("organizationId", ["organizationId"]),
175
+
176
+ teamMember: defineTable({
177
+ teamId: v.string(),
178
+ userId: v.string(),
179
+ createdAt: v.optional(v.union(v.null(), v.number())),
180
+ })
181
+ .index("teamId", ["teamId"])
182
+ .index("userId", ["userId"]),
183
+
168
184
  organization: defineTable({
169
185
  name: v.string(),
170
186
  slug: v.optional(v.union(v.null(), v.string())),
@@ -201,21 +217,6 @@ const schema = defineSchema({
201
217
  .index("status", ["status"])
202
218
  .index("inviterId", ["inviterId"]),
203
219
 
204
- team: defineTable({
205
- name: v.string(),
206
- organizationId: v.string(),
207
- createdAt: v.number(),
208
- updatedAt: v.optional(v.union(v.null(), v.number())),
209
- })
210
- .index("organizationId", ["organizationId"]),
211
-
212
- teamMember: defineTable({
213
- teamId: v.string(),
214
- userId: v.string(),
215
- createdAt: v.optional(v.union(v.null(), v.number())),
216
- })
217
- .index("userId", ["userId"]),
218
-
219
220
  ssoProvider: defineTable({
220
221
  issuer: v.string(),
221
222
  oidcConfig: v.optional(v.union(v.null(), v.string())),
@@ -347,6 +348,28 @@ export const specialFields = {
347
348
  unique: true
348
349
  }
349
350
  },
351
+ team: {
352
+ organizationId: {
353
+ references: {
354
+ model: "organization",
355
+ field: "id"
356
+ }
357
+ }
358
+ },
359
+ teamMember: {
360
+ teamId: {
361
+ references: {
362
+ model: "team",
363
+ field: "id"
364
+ }
365
+ },
366
+ userId: {
367
+ references: {
368
+ model: "user",
369
+ field: "id"
370
+ }
371
+ }
372
+ },
350
373
  organization: {
351
374
  name: {
352
375
  sortable: true
@@ -399,22 +422,6 @@ export const specialFields = {
399
422
  }
400
423
  }
401
424
  },
402
- team: {
403
- organizationId: {
404
- references: {
405
- model: "organization",
406
- field: "id"
407
- }
408
- }
409
- },
410
- teamMember: {
411
- userId: {
412
- references: {
413
- model: "user",
414
- field: "id"
415
- }
416
- }
417
- },
418
425
  ssoProvider: {
419
426
  userId: {
420
427
  references: {