3 ms·
These are not migrations in the traditional sense. I was referring to DDL. Nevertheless: > "Update the values in column X with the contents of file Y that exis
by sgarland 2y ago
These are not migrations in the traditional sense. I was referring to DDL. Nevertheless:
> "Update the values in column X with the contents of file Y that exists in Amazon S3"
You actually can do that in SQL, assuming it’s hosted on AWS (or for Postgres, you’ve installed the correct extension). It would be a bit convoluted (I think to handle the UPDATE, you’d first dump from S3 into a temp table, then update from that), but it would work.
> A SQL query "DELETE FROM users" might be correct, but if you meant for it to be "DELETE FROM users WHERE id IN (...)" it's going to cause problems.
If someone doesn’t notice this issue in SQL, they’re not going to notice it in an ORM, either. It’s also possible (and a good idea) to enforce predicates for DELETE at a server configuration level, such that the DB will refuse to execute them. And really, if you actually want to delete everything in a table, you should be using TRUNCATE anyway.