backpack1098B
Convex Community2y ago
1 reply
backpack1098

run migration on prod before pushing new schema?

i've added a new column to my table, after running a migration on local,
// schema.ts
rank: v.optional(v.number()),

export const addRankToImages = migration({
  table: "images",
  migrateOne: async (ctx, image) => {
    if (!image.rank) {
      await ctx.db.patch(image._id, { rank: 0 })
    }
  },
})

can i run the migration on production before pushing the new schema? i also have rank an optional field now
Was this page helpful?