-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrating on existing tenants in Production #66
Comments
@churcho sorry it took so long, what do you mean? |
If you use release though, that is a little bit trickier, but you can combine |
@kelvinst it would be nice if
worked but alas it doesn't as Triplex.all returns a list of prefixes which Triplex.migrate then applies it is not difficult to work around and running
works in a production terminal to do the tenant migrations. |
Yeah, we actually need to think of better ways of doing those. Maybe a `Triplex.migrate_all` function would make it easier, but we still have to come up with a better way to decide when to apply `to_prefix` and when not to apply it. I just can’t figure any way of doing that without breaking the API so hard that we would need to bump the version to 2.0.
Best,
Kelvin Stinghen
[email protected]
… On Sep 16, 2019, at 16:24, Stuart Eccles ***@***.***> wrote:
@kelvinst <https://github.com/kelvinst> it would be nice if
Enum.each(Triplex.all, &Triplex.migrate(&1) end)
worked but alas it doesn't as Triplex.all returns a list of prefixes which Triplex.migrate then applies to_prefix on again...
it is not difficult to work around and running
Enum.each(Triplex.all, &Ecto.Migrator.run(
My.Repo,
Triplex.migrations_path(My.Repo),
:up,
all: true,
prefix: &1
))
works in a production terminal to do the tenant migrations.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#66?email_source=notifications&email_token=AAVJUHKX5RZMWH5423G7P5TQJ7MOBA5CNFSM4G7OI6I2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD62HTJI#issuecomment-531921317>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAVJUHNQWSRYBT2ULXXOZRDQJ7MOBANCNFSM4G7OI6IQ>.
|
We’re open to suggestions though.
Best,
Kelvin Stinghen
[email protected]
… On Sep 16, 2019, at 16:55, Kelvin Stinghen ***@***.***> wrote:
Yeah, we actually need to think of better ways of doing those. Maybe a `Triplex.migrate_all` function would make it easier, but we still have to come up with a better way to decide when to apply `to_prefix` and when not to apply it. I just can’t figure any way of doing that without breaking the API so hard that we would need to bump the version to 2.0.
Best,
Kelvin Stinghen
***@***.*** ***@***.***>
> On Sep 16, 2019, at 16:24, Stuart Eccles ***@***.*** ***@***.***>> wrote:
>
> @kelvinst <https://github.com/kelvinst> it would be nice if
>
> Enum.each(Triplex.all, &Triplex.migrate(&1) end)
> worked but alas it doesn't as Triplex.all returns a list of prefixes which Triplex.migrate then applies to_prefix on again...
>
> it is not difficult to work around and running
>
> Enum.each(Triplex.all, &Ecto.Migrator.run(
> My.Repo,
> Triplex.migrations_path(My.Repo),
> :up,
> all: true,
> prefix: &1
> ))
> works in a production terminal to do the tenant migrations.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub <#66?email_source=notifications&email_token=AAVJUHKX5RZMWH5423G7P5TQJ7MOBA5CNFSM4G7OI6I2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD62HTJI#issuecomment-531921317>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAVJUHNQWSRYBT2ULXXOZRDQJ7MOBANCNFSM4G7OI6IQ>.
>
|
Anyway, we are currently working on a braking change that would force some people to add another lib to their projects if they want the plugs, so why not? 🤷♂ |
How do you run migrations in production environments with no
mix
?I made changes to some of my tables and would like to propagate this to already existing tenants.
Do we need to keep a table with existing [tenants]?(
triplex/lib/triplex/config.ex
Line 19 in f49c43f
The text was updated successfully, but these errors were encountered: