Best approach for data migration: moving data from two columns to JSONB
Hi Drizzle community! 👋
I'm working on a schema migration where I need to:
1. Move data from two existing string columns (
old_col1
, old_col2
) into a new JSONB column (new_jsonb_col
)
2. Drop the old columns
3. Ensure no schema drift
My current idea:
1. Update TypeScript schema (add JSONB col, remove old cols)
2. Run drizzle-kit generate
3. Manually edit the generated migration to add data transformation steps:
Questions:
1. Is this the recommended approach for complex data migrations?
2. Should I use drizzle-kit generate --custom
instead?
3. Are there any gotchas I should be aware of?
I appreciate your support 🙏0 Replies