|
|
|
@ -209,6 +209,7 @@ async function addIfMissingAndSave() {
|
|
|
|
|
const updatedColMeta = { ...column.value } |
|
|
|
|
|
|
|
|
|
// todo: refactor and avoid repetition |
|
|
|
|
if (updatedColMeta.cdf) { |
|
|
|
|
// Postgres returns default value wrapped with single quotes & casted with type so we have to get value between single quotes to keep it unified for all databases |
|
|
|
|
if (isPg.value) { |
|
|
|
|
updatedColMeta.cdf = updatedColMeta.cdf.substring( |
|
|
|
@ -221,6 +222,7 @@ async function addIfMissingAndSave() {
|
|
|
|
|
if (!isMysql.value) { |
|
|
|
|
updatedColMeta.cdf = updatedColMeta.cdf.replace(/''/g, "'") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
await $api.dbTableColumn.update( |
|
|
|
|
(column.value as { fk_column_id?: string })?.fk_column_id || (column.value?.id as string), |
|
|
|
|