Closed rmarronnier closed 3 years ago
We now have support for citext https://github.com/luckyframework/avram/pull/608 This migration, however, is actually for the specs for Authentic. Generated apps would use this migration. So we'd need to update both spots as well as I'd like to see a spec on this shard to just ensure that having a citext email will actually work with different case emails.
Thanks for the suggestion on this!
Thanks for the migration pointer ! I'll take care of this in the next days.
Right off the bat, the two specs to be added I can think of are :
John@example.com
if an account with john@example.com
already existsJohn@example.com
to the john@example.com
accountYup! Those two specs would be great! Thanks
While trying to write the specs, I realized :
FakeAuthenticatable
object is used in the specs, mostly for password and session utilities testing.SignUp
and SignIn
actions and operations code are not in this repository (but in lucky-cli
)
We have to create a UserFactory
to really test how the db handle the citext
column. It's the easy part (already done but not pushed).We have nevertheless some decisions to make :
SignUp
and SignIn
operations ? I couldn't find on the lucky website the relevant documentation to test only operations in specs. Do you have an existing example ?SignUp
and SignIn
actions ? If so, only the API actions ? For the web actions, should we use lucky flow ?Also, copy-pasting code from the lucky-cli repo to test seems to me it could bite us later if we forget to update both repo. Is there any way to move all Authentic specific code from lucky-cli to the Authentic repo and make lucky-cli rely on Authentic shard for code generation ?
Fixes #9
Inspired by : http://shuber.io/case-insensitive-unique-constraints-in-postgres/
Do not merge this as it is :
CIString
type in Avram to automatically create a citext column type and use it in Authentic ?)Edit : https://www.postgresql.org/docs/current/citext.html