Open
Conversation
This removes the migration to update the production model. The migration only includes INSERT statements and a conditional to check for the current environment. Both are anti-patterns and will make our lives harder… So I opted for some raw SQL juggle instead and added the new model to the large SQL statement, more as a way to document it.
The env-specific condition was added after the migrations ran on staging/production, so it did not occur as a problem for the deployment (yet). I completely removed the statements, as they mess with the test database if we skip the conditional. For the dev environment, the seeds are already run with `mix ecto.setup`, so the state of the database should be fine.
Member
|
Looks good to me. |
xhr15
approved these changes
Jan 12, 2026
Member
Author
Hey @andreasknoepfle 👋 Sorry, I completely forgot about this PR for the last month 😂 I added the on conflict statements! Should I merge it like this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This removes the migration to update the production model. The migration
only includes INSERT statements and a conditional to check for the
current environment. Both are anti-patterns and will make our lives
harder…
So I opted for some raw SQL juggle instead and added the new model to
the large SQL statement, more as a way to document it.
Also: Remove env specific insert statements from migrations
The env-specific condition was added after the migrations ran on
staging/production, so it did not occur as a problem for the deployment
(yet).
I completely removed the statements, as they mess with the test database
if we skip the conditional. For the dev environment, the seeds are
already run with
mix ecto.setup, so the state of the database shouldbe fine.