diff options
author | Marc Alexander <admin@m-a-styles.de> | 2016-10-23 22:17:19 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-10-23 22:17:19 +0200 |
commit | 6f8c0df1c68a2f7812c10ffd489098f50401022d (patch) | |
tree | 40942ecd91991a3689c66e4262e95fce763e96f6 /phpBB | |
parent | c891277996872920f88ea7bb36b1e57e3674579f (diff) | |
download | forums-6f8c0df1c68a2f7812c10ffd489098f50401022d.tar forums-6f8c0df1c68a2f7812c10ffd489098f50401022d.tar.gz forums-6f8c0df1c68a2f7812c10ffd489098f50401022d.tar.bz2 forums-6f8c0df1c68a2f7812c10ffd489098f50401022d.tar.xz forums-6f8c0df1c68a2f7812c10ffd489098f50401022d.zip |
[ticket/14831] Compare depends_on for migrations and remove prefixless names
PHPBB3-14831
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/phpbb/db/migration/data/v31x/migrations_deduplicate_entries.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/phpBB/phpbb/db/migration/data/v31x/migrations_deduplicate_entries.php b/phpBB/phpbb/db/migration/data/v31x/migrations_deduplicate_entries.php index 4e539cf36d..5f883952b4 100644 --- a/phpBB/phpbb/db/migration/data/v31x/migrations_deduplicate_entries.php +++ b/phpBB/phpbb/db/migration/data/v31x/migrations_deduplicate_entries.php @@ -55,21 +55,21 @@ class migrations_deduplicate_entries extends \phpbb\db\migration\migration $prepended_name = preg_replace('#^(?!\\\)#', '\\\$0', $name); $prefixless_name = preg_replace('#(^\\\)([^\\\].+)#', '$2', $name); - if ($prepended_name !== $name && isset($migration_state[$prepended_name]) && $migration_state[$prepended_name] === $migration_state[$name]) + if ($prepended_name != $name && isset($migration_state[$prepended_name]) && $migration_state[$prepended_name]['migration_depends_on'] == $migration_state[$name]['migration_depends_on']) { $duplicate_migrations[] = $name; unset($migration_state[$prepended_name]); } - else if ($prefixless_name !== $name && isset($migration_state[$prefixless_name]) && $migration_state[$prefixless_name] === $migration_state[$name]) + else if ($prefixless_name != $name && isset($migration_state[$prefixless_name]) && $migration_state[$prefixless_name]['migration_depends_on'] == $migration_state[$name]['migration_depends_on']) { - $duplicate_migrations[] = $name; + $duplicate_migrations[] = $prefixless_name; unset($migration_state[$prefixless_name]); } } if (count($duplicate_migrations)) { - $sql = 'DELETE * + $sql = 'DELETE FROM ' . $this->table_prefix . 'migrations WHERE ' . $this->db->sql_in_set('migration_name', $duplicate_migrations); $this->db->sql_query($sql); |