| @@ 634-651 (lines=18) @@ | ||
| 631 | } |
|
| 632 | // grab tables from each model |
|
| 633 | $tables_to_check = array(); |
|
| 634 | foreach (EE_Registry::instance()->non_abstract_db_models as $model_name) { |
|
| 635 | if (method_exists($model_name, 'instance')) { |
|
| 636 | $model_obj = call_user_func(array($model_name, 'instance')); |
|
| 637 | if ($model_obj instanceof EEM_Base) { |
|
| 638 | foreach ($model_obj->get_tables() as $table) { |
|
| 639 | if ( |
|
| 640 | strpos($table->get_table_name(), 'esp_') |
|
| 641 | && (is_main_site()//for main tables, verify global tables |
|
| 642 | || ! $table->is_global()//if not the main site, then only verify non-global tables (avoid doubling up) |
|
| 643 | ) |
|
| 644 | && function_exists('maybe_convert_table_to_utf8mb4') |
|
| 645 | ) { |
|
| 646 | $tables_to_check[] = $table->get_table_name(); |
|
| 647 | } |
|
| 648 | } |
|
| 649 | } |
|
| 650 | } |
|
| 651 | } |
|
| 652 | //and let's just be sure these addons' tables get migrated too. They already get handled if their addons are active |
|
| 653 | //when this code is run, but not otherwise. Once we record what tables EE added, we'll be able to use that instead |
|
| 654 | //of hard-coding this |
|
| @@ 1606-1623 (lines=18) @@ | ||
| 1603 | { |
|
| 1604 | $tables = array(); |
|
| 1605 | // load registry |
|
| 1606 | foreach (EE_Registry::instance()->non_abstract_db_models as $model_name) { |
|
| 1607 | if (method_exists($model_name, 'instance')) { |
|
| 1608 | $model_obj = call_user_func(array($model_name, 'instance')); |
|
| 1609 | if ($model_obj instanceof EEM_Base) { |
|
| 1610 | foreach ($model_obj->get_tables() as $table) { |
|
| 1611 | if (strpos($table->get_table_name(), 'esp_') |
|
| 1612 | && |
|
| 1613 | ( |
|
| 1614 | is_main_site()//main site? nuke them all |
|
| 1615 | || ! $table->is_global()//not main site,but not global either. nuke it |
|
| 1616 | ) |
|
| 1617 | ) { |
|
| 1618 | $tables[] = $table->get_table_name(); |
|
| 1619 | } |
|
| 1620 | } |
|
| 1621 | } |
|
| 1622 | } |
|
| 1623 | } |
|
| 1624 | ||
| 1625 | //there are some tables whose models were removed. |
|
| 1626 | //they should be removed when removing all EE core's data |
|