How to do migrations that require data changes?

Hi, how can I migrate a live database that requires to do a more complicated data shuffling, e.g. I have this schema:
const Pages = pgTable('pages', {
    id: uuid('id').defaultRandom().primaryKey(),
    title: text('title').notNull(),
    status: text('status', { enum: ['draft', 'published', 'deleted'] })
      .notNull()
      .default('draft'),
    // ...other columns
});


If I do this change:
// remove
status: text('status', { enum: ['draft', 'published', 'deleted'] })
  .notNull()
  .default('draft'),
// add
status: integer('status').notNull().default(1),


It will need more than drizzle-kit is providing, e.g. update query to map existing data to new data. Is drizzle-kit able to handle this case by providing additional code/sql and if not does it mean that I need to do it manually and then reset drizzle snapshots to be able to continue with drizzle-kit from there?
Was this page helpful?