smpallen99 / coherence

Coherence is a full featured, configurable authentication system for Phoenix
MIT License
1.27k stars 224 forks source link

Place default generated schema created by coh.install in lib/my_app/coherence/user.ex #224

Closed smpallen99 closed 7 years ago

smpallen99 commented 7 years ago

Create default user schema module MyApp.Coherence.User and table "coherence_users".

tmbb commented 7 years ago

I prefer the current table name "users" instead of "coherence_users". the important thing is that it holds users, not that those users are managed by coherence.

tmbb commented 7 years ago

Do you want to change the name because of the way "new naming scheme" in Phoenix 1.3 that includes the context? That's been removed from Phoenix in the release candidate because of user feedback (rightly, in mu opinion)

smpallen99 commented 7 years ago

Let me check on that. thanks @tmbbb

smpallen99 commented 7 years ago

just to be clear @tmbb, the change is just to remove the context_ from the table name, right? so, instead of table name :coherence_users, I should use just :users?

smpallen99 commented 7 years ago

@tmbb. Just noticed one of your comments above. I'll change it to users. Thanks!!

tmbb commented 7 years ago

I think of a contexts as if it were a way to look at a set of DB tables... I'm not sure this is the official gospel, but it's a perspective I find useful... To me it works like this:

The change you suggest in this Issue is the same as creating a Coherence context with a single schema, the User. I think it's great that coherence embraces contexts, and of course it still works with Tye code in my Pull Request (basically the User schema in the Coherence context would be a superset of all the user contexts defined by the user in the app).