I have this statement in the database modeling file and would like to know what it is about.
'price_type' enum("S" "M")
I have this statement in the database modeling file and would like to know what it is about.
'price_type' enum("S" "M")
This is a enum .
With an enum you can restrict the values of a column to the specified options, eg in your case 'S'
or 'M'
.
Enum is a fairly efficient and compact type. Internally the bank uses numbers to represent each value of enum
. Generally we use enum when the values of a column belong to a well defined and static universe (ie, you do not predict new types of price, if this were the case a foreign key for a domain table with the types of price would be a better solution ).