Kurisu
How to run a specific Ecto migration file in the console while preventing it to be tracked?
I want to run a specific migration file but I want it to keep its pending status on next call of ecto_migrate.
Please, is quiet the right option to pass to the command?
Like for example:
mix ecto.migrate --quiet --to 20080906120000
And incidentally which option will allow me to run only one given migration file if there are several pending migrations?
Thanks
Marked As Solved
NobbZ
--quiet just surpresses output, or at least parts of it.
I do not think there is a way to run a migration without marking it as “done”. Also, I do not think its possible to run a single migration file out of order.
Migrations describe changes to a database schema over time.
Also Liked
cnck1387
I do this too.
As long as the app hasn’t shipped yet I just keep around a single migration file and I change it around as needed.
Another thing you might want to set up is a way to generate fake data for development. Then you can drop the db → run your single master migration file → generate new fake data in about 3 seconds once you get used to running the combo.
Kurisu
I guess I have to learn more psql commands…
Please, by any chance is there a way I can convert an Ecto migration file to pure psql command that I can paste in the psql console and execute it?
Edit: I mean I find it really easier to write Ecto queries instead of PostgreSQL ones.
NobbZ
If you have queries that you need more often than once, wrap them in a mix task, if it’s one off queries, do them on iex.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









