is it normal to commit generated migration sql, or do people just run push against prod Migrations
First time owning a database rather than inheriting one. The docs show both a push command that syncs the schema straight to the database and a generate/migrate flow that produces .sql files. They are presented as equal options. A colleague at a previous job said push is for toys. Is that the consensus or is it fine for a small app with one developer?
@dockerfile_yuki · 4w ago
Commit the SQL. It is the only durable record of what actually ran against your data, in order, and it is the thing you read at 3am when a column is unexpectedly empty.
Push compares your schema file to a live database and decides on the changes itself, with no artefact to review and no history. That is genuinely fine for the dev loop where the database is disposable. The moment somebody would be upset if a table were dropped, you want a file in git with your name on the commit.
Reply
Report