© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•2w ago
MyLizard

Data Update Migrations

🟢SQL
I've got a branch where I want to consolidate many cron jobs into one. To do that I need to:
1. create a new table,
2. pull data from the existing cron jobs into that new table,
3. create one new cron job, and
4. delete all the old cron jobs.

I'm building this in my local environmnent, but I'm not sure the best way to move the data around. Should I do this with a migration, which will run on Prod automatically, or should I just include the table build in the migration and run the data movement script manually against the database?

The documentation suggests I should only make schema changes in migrations.

In my case I could mange that by just choosing a time in-between cron runs.

But I'm curious about modifications to an active production database where the tables in question are in constant active use and where limiting downtime is essential. A data movement migration script seems very useful in that context, since it would run as soon as the objects have been modified.

Is there a better way?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Migrations preserving data
SupabaseSSupabase / help-and-questions
4y ago
migrations - schema and data best practise
SupabaseSSupabase / help-and-questions
4y ago
Can I update the migrations files to create meta data in production?
SupabaseSSupabase / help-and-questions
4y ago
How to seed between migrations, to test your new migrations work on existing data?
SupabaseSSupabase / help-and-questions
5mo ago