@axium/server 0.36.4 → 0.36.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/database.js +2 -2
- package/package.json +1 -1
package/dist/database.js
CHANGED
|
@@ -695,7 +695,7 @@ function columnFromSchema(column, allowPK) {
|
|
|
695
695
|
if (column.onDelete)
|
|
696
696
|
col = col.onDelete(column.onDelete);
|
|
697
697
|
if ('default' in column)
|
|
698
|
-
col = col.defaultTo(column.default);
|
|
698
|
+
col = col.defaultTo(sql.raw(String(column.default)));
|
|
699
699
|
if (column.check)
|
|
700
700
|
col = col.check(sql.raw(column.check));
|
|
701
701
|
return col;
|
|
@@ -738,7 +738,7 @@ export async function applyDelta(delta, forceAbort = false) {
|
|
|
738
738
|
}
|
|
739
739
|
for (const [colName, column] of Object.entries(tableDelta.alter_columns)) {
|
|
740
740
|
if (column.default)
|
|
741
|
-
await query.alterColumn(colName, col => col.setDefault(column.default)).execute();
|
|
741
|
+
await query.alterColumn(colName, col => col.setDefault(sql.raw(String(column.default)))).execute();
|
|
742
742
|
if (column.type)
|
|
743
743
|
await query.alterColumn(colName, col => col.setDataType(sql.raw(column.type))).execute();
|
|
744
744
|
for (const op of column.ops ?? []) {
|