@strapi/database 5.0.6 → 5.1.1
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/index.js
CHANGED
|
@@ -643,7 +643,7 @@ class MysqlSchemaInspector {
|
|
|
643
643
|
columns: [index2.Column_name],
|
|
644
644
|
name: index2.Key_name
|
|
645
645
|
};
|
|
646
|
-
if (!index2.Non_unique) {
|
|
646
|
+
if (!index2.Non_unique || index2.Non_unique === "0") {
|
|
647
647
|
indexInfo.type = "unique";
|
|
648
648
|
}
|
|
649
649
|
ret[index2.Key_name] = indexInfo;
|
|
@@ -1307,7 +1307,7 @@ const createSchemaDiff = (db) => {
|
|
|
1307
1307
|
const hasChangedStatus = (diff) => diff.status === statuses.CHANGED;
|
|
1308
1308
|
const diffIndexes = (oldIndex, index2) => {
|
|
1309
1309
|
const changes = [];
|
|
1310
|
-
if (
|
|
1310
|
+
if (___default.default.xor(oldIndex.columns, index2.columns).length > 0) {
|
|
1311
1311
|
changes.push("columns");
|
|
1312
1312
|
}
|
|
1313
1313
|
if (oldIndex.type && index2.type && ___default.default.toLower(oldIndex.type) !== ___default.default.toLower(index2.type)) {
|
|
@@ -4222,7 +4222,7 @@ const applyWhere = (qb, where) => {
|
|
|
4222
4222
|
});
|
|
4223
4223
|
};
|
|
4224
4224
|
const fieldLowerFn = (qb) => {
|
|
4225
|
-
if (qb.client.
|
|
4225
|
+
if (qb.client.dialect === "postgresql") {
|
|
4226
4226
|
return "LOWER(CAST(?? AS VARCHAR))";
|
|
4227
4227
|
}
|
|
4228
4228
|
return "LOWER(??)";
|
|
@@ -6433,6 +6433,7 @@ const createPublishedAtColumn = async (db, tableName) => {
|
|
|
6433
6433
|
await db.schema.alterTable(tableName, (table) => {
|
|
6434
6434
|
table.string("published_at");
|
|
6435
6435
|
});
|
|
6436
|
+
await db(tableName).update({ published_at: /* @__PURE__ */ new Date() });
|
|
6436
6437
|
};
|
|
6437
6438
|
const createdPublishedAt = {
|
|
6438
6439
|
name: "5.0.0-04-created-published-at",
|