Updates
This commit is contained in:
@@ -30,6 +30,7 @@ export default function generateColumnDescription({
|
||||
onUpdateLiteral,
|
||||
notNullValue,
|
||||
unique,
|
||||
options,
|
||||
} = columnData;
|
||||
|
||||
let fieldEntryText = "";
|
||||
@@ -41,7 +42,13 @@ export default function generateColumnDescription({
|
||||
finalDataTypeObject.decimal
|
||||
);
|
||||
|
||||
fieldEntryText += `\`${fieldName}\` ${finalDataType}`;
|
||||
if (finalDataType.match(/enum/i) && options?.[0]) {
|
||||
fieldEntryText += `\`${fieldName}\` ${finalDataType}(${options
|
||||
.map((opt) => `'${opt}'`)
|
||||
.join(",")})`;
|
||||
} else {
|
||||
fieldEntryText += `\`${fieldName}\` ${finalDataType}`;
|
||||
}
|
||||
|
||||
if (nullValue) {
|
||||
fieldEntryText += " DEFAULT NULL";
|
||||
|
||||
Reference in New Issue
Block a user