Integrate local business workflow and SaaS redesign

This commit is contained in:
2026-06-12 21:08:35 +02:00
parent f00c5a3193
commit 21c7e4c9a4
88 changed files with 2683 additions and 849 deletions

View File

@@ -10,7 +10,7 @@ for Convex schema and data migrations.
users: defineTable({
name: v.string(),
role: v.optional(v.union(v.literal("user"), v.literal("admin"))),
});
}).index("by_role", ["role"]);
// Migration: backfill the field
export const addDefaultRole = migrations.define({
@@ -225,7 +225,7 @@ export const verifyMigration = query({
handler: async (ctx) => {
const remaining = await ctx.db
.query("users")
.filter((q) => q.eq(q.field("role"), undefined))
.withIndex("by_role", (q) => q.eq("role", undefined))
.take(10);
return {