arangox_ecto icon indicating copy to clipboard operation
arangox_ecto copied to clipboard

Make migrate usable without mix to use in prod environment

Open ilourt opened this issue 2 years ago • 5 comments
trafficstars

ArangoXEcto version

v1.3.1

Feature type

Change to existing functionality

Proposed functionality

Now we can't use migration in a release because it depends on mix which is not available in this case.

The idea is to move code from Mix.ArangoXEcto and part of Mix.Tasks.Ecto.Migrate.Arango to inner modules in ArangoXEcto. On top of that, it is needed to remove dependencies to Mix inside these modules. Otherwise it is impossible to create a function in the release file to allow use of migrations in prod environment.

An idea is to do a similar work than ecto_sql with their migrator: https://github.com/elixir-ecto/ecto_sql/blob/master/lib/ecto/migrator.ex

Use case

It will allow to use migrations in prod environment, which is needed to deploy an app based on ArangoXEcto using an Arango cluster.

An Arango cluster can not create all collection on the fly and, without migrations index can not be defined in the dev environment and replicate in the prod env.

Version changes

No response

External dependencies

No response

Additional Context

No response

ilourt avatar Oct 26 '23 08:10 ilourt

I came across this the other week and came to the same conclusion. It is something that is on the list for 1.4. If you feel like making a PR before then, please by all means. At the moment when I have time I am working on improved logging and telemetry.

TomGrozev avatar Oct 29 '23 10:10 TomGrozev

Now I am in a hurry to ship a project. When it will be done, I will try to do it if I have not another shipping urgency ;)

ilourt avatar Nov 10 '23 10:11 ilourt

I am pretty busy at the moment but will get to it when I can. I encourage you to make a PR. You can also get around it by running a shell command in your release file.

TomGrozev avatar Nov 10 '23 21:11 TomGrozev

My previous message was not clear ;)

When "I said I am in a hurry to ship", it means that I don't have time to do the PR. For the moment I found a workaround with an init container which can do the migrations.

It was not to put pressure on you to do the PR.

ilourt avatar Nov 14 '23 09:11 ilourt

My previous message was not clear ;)

When "I said I am in a hurry to ship", it means that I don't have time to do the PR. For the moment I found a workaround with an init container which can do the migrations.

It was not to put pressure on you to do the PR.

This will be available in the next version and has mostly been completed (just doing some tests and docs now).

TomGrozev avatar Mar 14 '24 19:03 TomGrozev