DEV Community

Discussion on: Postgres enums with Rails

Collapse
 
antico5 profile image
Armando Andini

Thanks for sharing this knowledge!

I noticed a mistake on the migration:

              WHEN 0 THEN 'email'::user_notification_channel
              WHEN 0 THEN 'webpush'::user_notification_channel
              WHEN 0 THEN 'facebook'::user_notification_channel

Every value is 0, I think it should be 0, 1 and 2.

Collapse
 
johand profile image
Johan

Nice post @dsalahutdinov , apart from what @antico5 says I see another detail here, is that the last one should be

WHEN 2 THEN 'telegram'::user_notification_channel

instead of

WHEN 2 THEN 'facebook'::user_notification_channel
Collapse
 
dsalahutdinov profile image
Dmitry Salahutdinov

@johand , thanks, fixed