parsisolution / gateway

Iranian Payment Gateways
MIT License
19 stars 7 forks source link

ENUM is Evil! #31

Closed erfansahaf closed 2 years ago

erfansahaf commented 5 years ago

This is a gateway package that will get developed during the time and new providers will be added so why are you using ENUM datatype in your migration? You all owner of these gateway packages (Larabook, PasiSolution or Shirazsoft) are making the same mistake, ENUM is evil! Besides, it was created to get used for those fields which will not accept any new value ever!! If you are going to add new values (just like new providers name), the port field should not be ENUM, it should be INT or String (I prefer the INT one) so it can have new values. The main reason that I don't use these gateway packages is their Migrations have a poor design. If you want to read more about this, take a look at this article.

hamed-ehtesham commented 5 years ago

Hi Erfan, thanks for your suggestion, i'm gonna change that in version 2 which is still on alpha phase, and thanks for introducing that article, i read it

aliqasemzadeh commented 5 years ago

Hello, Just change it to varchar.