mirror of
https://github.com/strapi/strapi.git
synced 2025-07-24 17:40:18 +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 tableNameRegex = new RegExp(`.*${tableNameSuffix}$`);
|
||||
const tableNames = await findTables({ strapi }, tableNameRegex);
|
||||
if (!tableNames.length) {
|
||||
return;
|
||||
}
|
||||
await removePersistedTables({ strapi }, tableNames);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user