coherence icon indicating copy to clipboard operation
coherence copied to clipboard

--reinstall doesn't update the migrations and the templates

Open pmontrasio opened this issue 8 years ago • 3 comments

I added coherence to my project with mix coh.install and verified that it generated the *_create_coherence_user.exs migration file.

Then I reinstalled with some options

mix coh.install --reinstall --authenticatable --no-invitable --no-registerable \
  --no-confirmable --recoverable --trackable --no-lockable --rememberable

The migration file didn't change (no fields for rememberable, trackable and recoverable) and it didn't generate any other migration.

I restarted from the previous commit and run

mix coh.install --authenticatable --no-invitable --no-registerable \
  --no-confirmable --recoverable --trackable --no-lockable --rememberable

This gave me the two migrations I expected and the fields corresponding to the options

priv/repo/migrations/20170711084307_create_coherence_user.exs
priv/repo/migrations/20170711084308_create_coherence_rememberable.exs

I'm using

{:phoenix, "~> 1.3.0-rc", override: true},
{:postgrex, ">= 0.0.0"},
{:coherence, github: "smpallen99/coherence", branch: "phx-1.3"}
...

pmontrasio avatar Jul 11 '17 09:07 pmontrasio

I changed my mind about invitable and reinstalled with

ix coh.install --reinstall --authenticatable --invitable --no-registerable \
  --no-confirmable --recoverable --trackable --no-lockable --rememberable

It didn't create the migration for the invitable table.

pmontrasio avatar Jul 11 '17 09:07 pmontrasio

It didn't add lib/myapp/web/templates/coherence/invitation/* and lib/myapp/web/views/coherence/invitation_view.ex so I changed the title of the issue adding "and the templates".

As a workaround I run the command without --reinstall, answered n to the prompt of overwriting the configuration file and removed the *add* migrations.

I had to add invitable manually to config.exs

-  opts: [:rememberable, :trackable, :recoverable, :authenticatable]
+  opts: [:rememberable, :trackable, :recoverable, :invitable, :authenticatable]

pmontrasio avatar Jul 11 '17 10:07 pmontrasio

Please review the coh.install task docs and look at the Reinstall Examples section. By default, reinstall does not generate migrations. You need to add the --with-migrations option and then remove the old migration files manually.

smpallen99 avatar Jul 30 '17 19:07 smpallen99