File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
system/database/drivers/mysql Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -87,11 +87,26 @@ function _process_fields($fields)
87
87
if (array_key_exists ('TYPE ' , $ attributes ))
88
88
{
89
89
$ sql .= ' ' .$ attributes ['TYPE ' ];
90
- }
91
90
92
- if (array_key_exists ('CONSTRAINT ' , $ attributes ))
93
- {
94
- $ sql .= '( ' .$ attributes ['CONSTRAINT ' ].') ' ;
91
+ if (array_key_exists ('CONSTRAINT ' , $ attributes ))
92
+ {
93
+ switch ($ attributes ['TYPE ' ])
94
+ {
95
+ case 'decimal ' :
96
+ case 'float ' :
97
+ case 'numeric ' :
98
+ $ sql .= '( ' .implode (', ' , $ attributes ['CONSTRAINT ' ]).') ' ;
99
+ break ;
100
+
101
+ case 'enum ' :
102
+ case 'set ' :
103
+ $ sql .= '(" ' .implode ('"," ' , $ attributes ['CONSTRAINT ' ]).'") ' ;
104
+ break ;
105
+
106
+ default :
107
+ $ sql .= '( ' .$ attributes ['CONSTRAINT ' ].') ' ;
108
+ }
109
+ }
95
110
}
96
111
97
112
if (array_key_exists ('UNSIGNED ' , $ attributes ) && $ attributes ['UNSIGNED ' ] === TRUE )
You can’t perform that action at this time.
0 commit comments