mirror of
https://github.com/strapi/strapi.git
synced 2025-07-26 02:20:32 +00:00
fix: do not remove tables if array is empty
This commit is contained in:
parent
e88eee0ecf
commit
c20f16e930
@ -124,6 +124,9 @@ const persistTablesWithPrefix = async (tableNamePrefix) => {
|
|||||||
const removePersistedTablesWithSuffix = async (tableNameSuffix) => {
|
const removePersistedTablesWithSuffix = async (tableNameSuffix) => {
|
||||||
const tableNameRegex = new RegExp(`.*${tableNameSuffix}$`);
|
const tableNameRegex = new RegExp(`.*${tableNameSuffix}$`);
|
||||||
const tableNames = await findTables({ strapi }, tableNameRegex);
|
const tableNames = await findTables({ strapi }, tableNameRegex);
|
||||||
|
if (!tableNames.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
await removePersistedTables({ strapi }, tableNames);
|
await removePersistedTables({ strapi }, tableNames);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user