1.1.3
This commit is contained in:
@@ -18,6 +18,7 @@ export default defineSchema({
|
||||
customStatus: v.optional(v.string()),
|
||||
joinSoundStorageId: v.optional(v.id("_storage")),
|
||||
accentColor: v.optional(v.string()),
|
||||
bannerStorageId: v.optional(v.id("_storage")),
|
||||
}).index("by_username", ["username"]),
|
||||
|
||||
categories: defineTable({
|
||||
@@ -191,6 +192,31 @@ export default defineSchema({
|
||||
.index("by_poll_user_emoji", ["pollId", "userId", "emoji"])
|
||||
.index("by_user", ["userId"]),
|
||||
|
||||
// Banned users — presence of a row = login + send blocked for that
|
||||
// user. Unique by `userId` (enforced by the only caller path —
|
||||
// `bans.ban` does an upsert, not raw insert).
|
||||
bans: defineTable({
|
||||
userId: v.id("userProfiles"),
|
||||
bannedBy: v.id("userProfiles"),
|
||||
reason: v.optional(v.string()),
|
||||
createdAt: v.number(),
|
||||
}).index("by_user", ["userId"]),
|
||||
|
||||
// Append-only log of admin-ish actions: channel / role edits, bans,
|
||||
// server settings changes. Target fields are stringly-typed so
|
||||
// entries can point at any table without a discriminated union.
|
||||
auditLog: defineTable({
|
||||
actorId: v.id("userProfiles"),
|
||||
action: v.string(),
|
||||
targetType: v.optional(v.string()),
|
||||
targetId: v.optional(v.string()),
|
||||
targetName: v.optional(v.string()),
|
||||
metadata: v.optional(v.any()),
|
||||
createdAt: v.number(),
|
||||
})
|
||||
.index("by_created_at", ["createdAt"])
|
||||
.index("by_actor", ["actorId"]),
|
||||
|
||||
savedMedia: defineTable({
|
||||
userId: v.id("userProfiles"),
|
||||
// Convex storage URL — also the dedupe key for a single user.
|
||||
|
||||
Reference in New Issue
Block a user