I'm thinking about using migrations only for tables, and then using a script that diffs everything else to local files - if the view, function, trigger etc differs from the file, drop it and recreate it.
So, on deploy we'd run prisma migrate, and then our own script that synchronizes non-table items.
This would allow us to treat all non-table objects as checked in source code - a single source of truth. Migrations for these kinds of objects just drop and recreate them anyway.
Is this a reasonable approach? Are there any tools that work like this that I could use so I don't have to write my own?