Procedure to drop schemaLocations where second part does not ends with '.xsd'

@return void
325583
public function removeIncompleteSchemaLocations()
    {
        $schemaLocations = $this->obtainXsiSchemaLocations();
        for ($s = 0; $s < $schemaLocations->length; $s++) {
            $element = $schemaLocations->item($s);
            if (null !== $element) {
                $element->nodeValue = $this->removeIncompleteSchemaLocation($element->nodeValue);
            }
        }
    }
205844
public function down()
    {
        $config = config('laravel-permission.table_names');

        Schema::drop($config['role_has_permissions']);
        Schema::drop($config['user_has_roles']);
        Schema::drop($config['user_has_permissions']);
        Schema::drop($config['roles']);
        Schema::drop($config['permissions']);
    }
705921
public function down()
    {
        // Disable foreign key constraints or these DROPs will not work
        DB::statement('SET FOREIGN_KEY_CHECKS = 0');


        ///////////////////////////////////////////////////////////////////////
        ////                       Lookup Tables                           ////
        ///////////////////////////////////////////////////////////////////////

        Schema::table('kb_lookup_categories', function($table){
            $table->dropIndex('kb_lookup_categories_title_unique');
            $table->dropForeign('kb_lookup_categories_created_by_foreign');
            $table->dropForeign('kb_lookup_categories_updated_by_foreign');
            $table->dropForeign('kb_lookup_categories_locked_by_foreign');
        });
        Schema::dropIfExists('kb_lookup_categories');


        ///////////////////////////////////////////////////////////////////////
        ////                    Main Tables                                ////
        ///////////////////////////////////////////////////////////////////////

        Schema::table('kb_items', function($table){
            $table->dropForeign('kb_items_kb_category_id_foreign');
            $table->dropForeign('kb_items_created_by_foreign');
            $table->dropForeign('kb_items_updated_by_foreign');
            $table->dropForeign('kb_items_locked_by_foreign');
        });
        Schema::dropIfExists('kb_items');

        // Enable foreign key constraints
        DB::statement('SET FOREIGN_KEY_CHECKS = 1');
    }
1103751
public function down()
    {
        $twoStepAuth = new TwoStepAuth();
        $connection = $twoStepAuth->getConnectionName();
        $table = $twoStepAuth->getTableName();

        Schema::connection($connection)->dropIfExists($table);
    }
699484
public function dropTable($name)
    {
        if (!$this->hasTable($name)) {
            throw SchemaException::schemaTableDoesNotExist($this->getName(), $name);
        }

        unset($this->tables[$name]);
    }
390838
public function dropAllTables()
    {
        $tables = [];

        $excludedTables = ['spatial_ref_sys'];

        foreach ($this->getAllTables() as $row) {
            $row = (array) $row;

            $table = reset($row);

            if (! in_array($table, $excludedTables)) {
                $tables[] = $table;
            }
        }

        if (empty($tables)) {
            return;
        }

        $this->connection->statement(
            $this->grammar->compileDropAllTables($tables)
        );
    }
857662
public function down()
    {
        Schema::table(
            'contents',
            function (Blueprint $table) {
                $table->removeColumn('type');
                $table->removeColumn('published');
            }
        );

        Schema::table(
            'revisions',
            function (Blueprint $table) {
                $table->removeColumn('published');
            }
        );
    }
340450
public function dropTables()
    {
        $table_prefix = $this->prefix(); // For the app.
        $tables_dir   = $this->App->Config->©fs_paths['§mysql']['§tables_dir'];

        if (!$tables_dir || !is_dir($tables_dir)) {
            return; // Not possible; no tables.
        }
        foreach ($this->c::dirRegexRecursiveIterator($tables_dir, '/\.sql$/ui') as $_Resource) {
            if (!$_Resource->isFile()) { // Not a file?
                continue; // Bypass; files only.
            }
            $_sql_file = $_Resource->getPathname();

            $_sql_file_table = basename($_sql_file, '.sql');
            $_sql_file_table = str_replace('-', '_', $_sql_file_table);
            $_sql_file_table = $table_prefix.$_sql_file_table;

            if ($this->wp->query('DROP TABLE IF EXISTS `'.esc_sql($_sql_file_table).'`') === false) {
                throw $this->c::issue(sprintf('DB table drop failure: `%1$s`.', $_sql_file_table));
            }
        } // unset($_Resource, $_sql_file, $_sql_file_table);
    }
189724
void delete() {
        StringBuilder sql = new StringBuilder();
        sql.append("DROP SCHEMA ");
        sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(this.name));
        if (this.sqlgGraph.getSqlDialect().supportsCascade()) {
            sql.append(" CASCADE");
        }
        if (this.sqlgGraph.getSqlDialect().needsSemicolon()) {
            sql.append(";");
        }
        if (logger.isDebugEnabled()) {
            logger.debug(sql.toString());
        }
        Connection conn = this.sqlgGraph.tx().getConnection();
        try (Statement stmt = conn.createStatement()) {
            stmt.execute(sql.toString());
        } catch (SQLException e) {
            logger.error("schema deletion failed " + this.sqlgGraph.toString(), e);
            throw new RuntimeException(e);
        }
    }
1335372
public function dropSchema($schemaName)
    {
        $sql = sprintf("DROP SCHEMA IF EXISTS %s CASCADE;", $this->quoteSchemaName($schemaName));
        $this->execute($sql);
    }
701253
public function down()
	{
        // Disable foreign key constraints or these DROPs will not work
        DB::statement('SET FOREIGN_KEY_CHECKS = 0');


        ///////////////////////////////////////////////////////////////////////
        ////                       Lookup Tables                           ////
        ///////////////////////////////////////////////////////////////////////

        Schema::table('lookup_address_types', function($table){
            $table->dropIndex('lookup_address_types_title_unique');
            $table->dropForeign('lookup_address_types_created_by_foreign');
            $table->dropForeign('lookup_address_types_updated_by_foreign');
            $table->dropForeign('lookup_address_types_locked_by_foreign');
        });
        Schema::dropIfExists('lookup_address_types');

        Schema::table('lookup_email_types', function($table){
            $table->dropIndex('lookup_email_types_title_unique');
            $table->dropForeign('lookup_email_types_created_by_foreign');
            $table->dropForeign('lookup_email_types_updated_by_foreign');
            $table->dropForeign('lookup_email_types_locked_by_foreign');
        });
        Schema::dropIfExists('lookup_email_types');

        Schema::table('lookup_social_types', function($table){
            $table->dropIndex('lookup_social_types_title_unique');
            $table->dropForeign('lookup_social_types_created_by_foreign');
            $table->dropForeign('lookup_social_types_updated_by_foreign');
            $table->dropForeign('lookup_social_types_locked_by_foreign');
        });
        Schema::dropIfExists('lookup_social_types');

        Schema::table('lookup_telephone_types', function($table){
            $table->dropIndex('lookup_telephone_types_title_unique');
            $table->dropForeign('lookup_telephone_types_created_by_foreign');
            $table->dropForeign('lookup_telephone_types_updated_by_foreign');
            $table->dropForeign('lookup_telephone_types_locked_by_foreign');
        });
        Schema::dropIfExists('lookup_telephone_types');

        Schema::table('lookup_website_types', function($table){
            $table->dropIndex('lookup_website_types_title_unique');
            $table->dropForeign('lookup_website_types_created_by_foreign');
            $table->dropForeign('lookup_website_types_updated_by_foreign');
            $table->dropForeign('lookup_website_types_locked_by_foreign');
        });
        Schema::dropIfExists('lookup_website_types');


        ///////////////////////////////////////////////////////////////////////
        ////                    Main Tables                                ////
        ///////////////////////////////////////////////////////////////////////

        Schema::table('companies', function($table){
            $table->dropIndex('companies_title_unique');
            $table->dropForeign('companies_created_by_foreign');
            $table->dropForeign('companies_updated_by_foreign');
            $table->dropForeign('companies_locked_by_foreign');
        });
        Schema::dropIfExists('companies');

        Schema::table('peoples', function($table){
            $table->dropForeign('peoples_user_id_foreign');
            $table->dropForeign('peoples_created_by_foreign');
            $table->dropForeign('peoples_updated_by_foreign');
            $table->dropForeign('peoples_locked_by_foreign');
        });
        Schema::dropIfExists('peoples');


        ///////////////////////////////////////////////////////////////////////
        ////          Tables Relating to the Main Tables                   ////
        ///////////////////////////////////////////////////////////////////////

        Schema::table('addresses', function($table){
            $table->dropForeign('addresses_address_type_id_foreign');
            $table->dropForeign('addresses_created_by_foreign');
            $table->dropForeign('addresses_updated_by_foreign');
            $table->dropForeign('addresses_locked_by_foreign');
        });
        Schema::dropIfExists('addresses');

        Schema::table('emails', function($table){
            $table->dropIndex('emails_title_unique');
            $table->dropForeign('emails_email_type_id_foreign');
            $table->dropForeign('emails_created_by_foreign');
            $table->dropForeign('emails_updated_by_foreign');
            $table->dropForeign('emails_locked_by_foreign');
        });
        Schema::dropIfExists('emails');

        Schema::table('socials', function($table){
            $table->dropIndex('socials_title_unique');
            $table->dropForeign('socials_social_type_id_foreign');
            $table->dropForeign('socials_created_by_foreign');
            $table->dropForeign('socials_updated_by_foreign');
            $table->dropForeign('socials_locked_by_foreign');
        });
        Schema::dropIfExists('socials');

        Schema::table('telephones', function($table){
            $table->dropForeign('telephones_telephone_type_id_foreign');
            $table->dropForeign('telephones_created_by_foreign');
            $table->dropForeign('telephones_updated_by_foreign');
            $table->dropForeign('telephones_locked_by_foreign');
        });
        Schema::dropIfExists('telephones');

        Schema::table('websites', function($table){
            $table->dropForeign('websites_website_type_id_foreign');
            $table->dropForeign('websites_created_by_foreign');
            $table->dropForeign('websites_updated_by_foreign');
            $table->dropForeign('websites_locked_by_foreign');
        });
        Schema::dropIfExists('websites');


        ///////////////////////////////////////////////////////////////////////
        ////               Pivot Tables for COMPANIES                      ////
        ///////////////////////////////////////////////////////////////////////

        Schema::table('company_people', function($table){
            $table->dropIndex('company_people_company_id_index');
            $table->dropForeign('company_people_company_id_foreign');
            $table->dropIndex('company_people_people_id_index');
            $table->dropForeign('company_people_people_id_foreign');
        });
        Schema::dropIfExists('company_people');

        Schema::table('company_address', function($table){
            $table->dropIndex('company_address_company_id_index');
            $table->dropForeign('company_address_company_id_foreign');
            $table->dropIndex('company_address_address_id_index');
            $table->dropForeign('company_address_address_id_foreign');
        });
        Schema::dropIfExists('company_address');

        Schema::table('company_email', function($table){
            $table->dropIndex('company_email_company_id_index');
            $table->dropForeign('company_email_company_id_foreign');
            $table->dropIndex('company_email_email_id_index');
            $table->dropForeign('company_email_email_id_foreign');
        });
        Schema::dropIfExists('company_email');

        Schema::table('company_social', function($table){
            $table->dropIndex('company_social_company_id_index');
            $table->dropForeign('company_social_company_id_foreign');
            $table->dropIndex('company_social_social_id_index');
            $table->dropForeign('company_social_social_id_foreign');
        });
        Schema::dropIfExists('company_social');

        Schema::table('company_telephone', function($table){
            $table->dropIndex('company_telephone_company_id_index');
            $table->dropForeign('company_telephone_company_id_foreign');
            $table->dropIndex('company_telephone_telephone_id_index');
            $table->dropForeign('company_telephone_telephone_id_foreign');
        });
        Schema::dropIfExists('company_telephone');

        Schema::table('company_website', function($table){
            $table->dropIndex('company_website_company_id_index');
            $table->dropForeign('company_website_company_id_foreign');
            $table->dropIndex('company_website_website_id_index');
            $table->dropForeign('company_website_website_id_foreign');
        });
        Schema::dropIfExists('company_website');


        ///////////////////////////////////////////////////////////////////////
        ////                 Pivot Tables for PEOPLES                      ////
        ///////////////////////////////////////////////////////////////////////

        Schema::table('people_address', function($table){
            $table->dropIndex('people_address_people_id_index');
            $table->dropForeign('people_address_people_id_foreign');
            $table->dropIndex('people_address_address_id_index');
            $table->dropForeign('people_address_address_id_foreign');
        });
        Schema::dropIfExists('people_address');

        Schema::table('people_email', function($table){
            $table->dropIndex('people_email_people_id_index');
            $table->dropForeign('people_email_people_id_foreign');
            $table->dropIndex('people_email_email_id_index');
            $table->dropForeign('people_email_email_id_foreign');
        });
        Schema::dropIfExists('people_email');

        Schema::table('people_social', function($table){
            $table->dropIndex('people_social_people_id_index');
            $table->dropForeign('people_social_people_id_foreign');
            $table->dropIndex('people_social_social_id_index');
            $table->dropForeign('people_social_social_id_foreign');
        });
        Schema::dropIfExists('people_social');

        Schema::table('people_telephone', function($table){
            $table->dropIndex('people_telephone_people_id_index');
            $table->dropForeign('people_telephone_people_id_foreign');
            $table->dropIndex('people_telephone_telephone_id_index');
            $table->dropForeign('people_telephone_telephone_id_foreign');
        });
        Schema::dropIfExists('people_telephone');

        Schema::table('people_website', function($table){
            $table->dropIndex('people_website_people_id_index');
            $table->dropForeign('people_website_people_id_foreign');
            $table->dropIndex('people_website_website_id_index');
            $table->dropForeign('people_website_website_id_foreign');
        });
        Schema::dropIfExists('people_website');


        // Enable foreign key constraints
        DB::statement('SET FOREIGN_KEY_CHECKS = 1');
	}
1102715
public function clean()
    {
        $this->removeAddenda();
        $this->removeIncompleteSchemaLocations();
        $this->removeNonSatNSNodes();
        $this->removeNonSatNSschemaLocations();
        $this->removeUnusedNamespaces();
    }
869596
public function down()
    {
        // Check if the 2 tables exist
        if (Schema::hasTable('tags') && Schema::hasTable('taggables')) {
            if (! Schema::hasColumn('tags', 'tagable_id') && ! Schema::hasColumn('tags', 'tagable_type')) {
                Schema::table('tags', function($table) {
                    $table->integer('tagable_id')->default(1);
                    $table->string('tagable_type', 32)->default('type');
                });
                $tags = DB::table('tags')->get();
                foreach ($tags as $tag) {
                    $tagable = DB::table('taggables')->where('tag_id', '=', $tag->id)->first();
                    if ($tagable) {
                        // Points to old namespace Redooor\\Redminportal\\
                        $old_type_array = explode('\\', $tagable->taggable_type);
                        $last_model = array_pop($old_type_array);
                        $old_type = 'Redooor\\Redminportal\\' . $last_model;
                        DB::table('tags')
                            ->where('id', $tag->id)
                            ->update([
                                'tagable_id' => $tagable->taggable_id,
                                'tagable_type' => $old_type
                            ]);
                    }
                }
            }
        }
    }
502351
public function down()
    {
        Schema::table('page_versions', function (Blueprint $table) {
            $table->renameColumn('created_at', 'edited_time');
            $table->renameColumn('created_by', 'edited_by');
        });

        Schema::table('asset_versions', function (Blueprint $table) {
            $table->renameColumn('created_at', 'edited_at');
            $table->renameColumn('created_by', 'edited_by');
        });

        Schema::table('assets', function (Blueprint $table) {
            $table->renameColumn('created_at', 'uploaded_time');
            $table->renameColumn('created_by', 'uploaded_by');
        });

        Schema::table('pages', function (Blueprint $table) {
            $table->renameColumn('created_at', 'created_time');
        });
    }
392390
protected function cleanUp()
    {
        $files = glob(__DIR__.DIRECTORY_SEPARATOR.'Mapping'.DIRECTORY_SEPARATOR.'{DataType,Property,Type}'.DIRECTORY_SEPARATOR.'*.php', GLOB_BRACE);
        foreach ($files as $file) {
            unlink($file);
        }
    }
102222
public function dispose() {
        // We shouldn't have any temp table registered at the end of the script.
        // So we error_log that and, at the same time, drop all the pending temptables
        if ($temptables = $this->get_temptables()) {
            error_log('Potential coding error - existing temptables found when disposing database. Must be dropped!');
            foreach ($temptables as $temptable) {
                 $this->mdb->get_manager()->drop_table(new xmldb_table($temptable));
            }
        }
        $this->mdb = null;
    }
1343229
public function down()
    {
        $activity = new Activity();
        $connection = $activity->getConnectionName();
        $table = $activity->getTableName();

        Schema::connection($connection)->dropIfExists($table);
    }