ateliware / triplex

Database multitenancy for Elixir applications!
MIT License
475 stars 49 forks source link

fix: do not use Mix during runtime #49

Closed dustinfarris closed 6 years ago

dustinfarris commented 6 years ago

Fixes #45.

I'm not sure if this is the best approach, but I think it could be a workaround at least.

There are still a couple failing tests I am working to resolve.

dustinfarris commented 6 years ago

I fixed the tests and squashed the commits. I've also tried it out on my staging server and I am able to create tenants and run migrations. This is ready for review and testing.

To try it out, use my fork of triplex:

# mix.exs
{:triplex, github: "dustinfarris/triplex", ref: "1340d22"},
mix do deps.clean triplex, deps.get

Everything should be the same, except it now works in OTP releases. Please report back if it works or does not.

/cc @vinceurag @kelvinst

vinceurag commented 6 years ago

Thanks for this @dustinfarris. I'm on my work now and will be trying this. Will get back to you with results. Have a nice day!

vinceurag commented 6 years ago

@dustinfarris I just tested it now. It works!! Thank you!

@kelvinst I verify that this fix works. :)

kelvinst commented 6 years ago

@dustinfarris thanks for the fix! I'm merging it to master now and will do a release until the weekend!

kelvinst commented 6 years ago

@dustinfarris can you please rebase it with the current master?

kelvinst commented 6 years ago

@reimo can you check if this fixed #41 too? It guess it has, can you check it please?

kelvinst commented 6 years ago

@dustinfarris, I've added some adjusts to you code... 😉

reimo commented 6 years ago

@kelvinst got my forked repo to work 2 days ago, was hoping to make a pr later this week Anyway, hope this PR sort that.

dustinfarris commented 6 years ago

@kelvinst rebased!

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-1.2%) to 98.788% when pulling a18624c8a116bfbc353f1f275eb517b11796bd2f on dustinfarris:migration-dir-config into f480012e369d7017b9551a0ac84e276d259bcc3a on ateliware:master.

kelvinst commented 6 years ago

Perfect! :)