@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.mjs
CHANGED
|
@@ -611,7 +611,7 @@ class MysqlSchemaInspector {
|
|
|
611
611
|
columns: [index2.Column_name],
|
|
612
612
|
name: index2.Key_name
|
|
613
613
|
};
|
|
614
|
-
if (!index2.Non_unique) {
|
|
614
|
+
if (!index2.Non_unique || index2.Non_unique === "0") {
|
|
615
615
|
indexInfo.type = "unique";
|
|
616
616
|
}
|
|
617
617
|
ret[index2.Key_name] = indexInfo;
|
|
@@ -1275,7 +1275,7 @@ const createSchemaDiff = (db) => {
|
|
|
1275
1275
|
const hasChangedStatus = (diff) => diff.status === statuses.CHANGED;
|
|
1276
1276
|
const diffIndexes = (oldIndex, index2) => {
|
|
1277
1277
|
const changes = [];
|
|
1278
|
-
if (
|
|
1278
|
+
if (_.xor(oldIndex.columns, index2.columns).length > 0) {
|
|
1279
1279
|
changes.push("columns");
|
|
1280
1280
|
}
|
|
1281
1281
|
if (oldIndex.type && index2.type && _.toLower(oldIndex.type) !== _.toLower(index2.type)) {
|
|
@@ -4190,7 +4190,7 @@ const applyWhere = (qb, where) => {
|
|
|
4190
4190
|
});
|
|
4191
4191
|
};
|
|
4192
4192
|
const fieldLowerFn = (qb) => {
|
|
4193
|
-
if (qb.client.
|
|
4193
|
+
if (qb.client.dialect === "postgresql") {
|
|
4194
4194
|
return "LOWER(CAST(?? AS VARCHAR))";
|
|
4195
4195
|
}
|
|
4196
4196
|
return "LOWER(??)";
|
|
@@ -6401,6 +6401,7 @@ const createPublishedAtColumn = async (db, tableName) => {
|
|
|
6401
6401
|
await db.schema.alterTable(tableName, (table) => {
|
|
6402
6402
|
table.string("published_at");
|
|
6403
6403
|
});
|
|
6404
|
+
await db(tableName).update({ published_at: /* @__PURE__ */ new Date() });
|
|
6404
6405
|
};
|
|
6405
6406
|
const createdPublishedAt = {
|
|
6406
6407
|
name: "5.0.0-04-created-published-at",
|