protected function rebuildTables($extraDataObjects = [])
    {
        DataObject::reset();

        // clear singletons, they're caching old extension info which is used in DatabaseAdmin->doBuild()
        Injector::inst()->unregisterObjects(DataObject::class);

        $dataClasses = ClassInfo::subclassesFor(DataObject::class);
        array_shift($dataClasses);

        $schema = $this->getConn()->getSchemaManager();
        $schema->quiet();
        $schema->schemaUpdate(function () use ($dataClasses, $extraDataObjects) {
            foreach ($dataClasses as $dataClass) {
                // Check if class exists before trying to instantiate - this sidesteps any manifest weirdness
                if (class_exists($dataClass)) {
                    $SNG = singleton($dataClass);
                    if (!($SNG instanceof TestOnly)) {
                        $SNG->requireTable();
                    }
                }
            }

            // If we have additional dataobjects which need schema, do so here:
            if ($extraDataObjects) {
                foreach ($extraDataObjects as $dataClass) {
                    $SNG = singleton($dataClass);
                    if (singleton($dataClass) instanceof DataObject) {
                        $SNG->requireTable();
                    }
                }
            }
        });

        ClassInfo::reset_db_cache();
        DataObject::singleton()->flushCache();
    }