Gets the dropped tables according to the old/new schemas.

@param \Fridge\DBAL\Schema\Schema $oldSchema The old schema.
@param \Fridge\DBAL\Schema\Schema $newSchema The new schema.

@return array The dropped tables.
503012
private function getDroppedTables(Schema $oldSchema, Schema $newSchema)
    {
        $droppedTables = array();

        foreach ($oldSchema->getTables() as $table) {
            if (!$newSchema->hasTable($table->getName())) {
                $droppedTables[] = $table;
            }
        }

        return $droppedTables;
    }
336704
public function dropTableSql(TableSchema $schema)
    {
        $sql = sprintf(
            'DROP TABLE %s',
            $this->_driver->quoteIdentifier($schema->name())
        );

        return [$sql];
    }
533853
public function getAllTable($hasStatus = false) {
        $this->command()
            ->changedDatabase($this->schema);
        if ($hasStatus) {
            return $this->command()
                ->select('SHOW TABLE STATUS');
        }
        $tables = $this->command()
            ->select('SHOW TABLES');
        foreach ($tables as &$table) {
            $table = current($table);
        }
        return $tables;
    }
1107424
public function getSchemaTables()
    {
        if ($this->schemaTables !== null) {
            return $this->schemaTables;
        }
        $builder = $this->app['schema.builder'];

        /** @deprecated Deprecated since 3.0, to be removed in 4.0. */
        $builder['extensions']->addPrefix($this->app['schema.prefix']);

        $schema = new Schema();
        $tables = array_merge(
            $builder['base']->getSchemaTables($schema),
            $builder['content']->getSchemaTables($schema, $this->config),
            $builder['extensions']->getSchemaTables($schema)
        );
        $this->schema = $schema;

        return $this->schemaTables = $tables;
    }
152630
public function getTableSchema(): ?TableSchema
    {
        if ($this->_tableSchema === null) {
            $this->_tableSchema = $this->db->getTableSchema($this->tableName);
        }

        return $this->_tableSchema;
    }
1311076
private static void copyProperties(Schema oldSchema, Schema newSchema) {
    Preconditions.checkNotNull(oldSchema);
    Preconditions.checkNotNull(newSchema);

    Map<String, JsonNode> props = oldSchema.getJsonProps();
    copyProperties(props, newSchema);
  }
905660
protected function processSchemas(\Doctrine\DBAL\Schema\Schema $newSchema, \Doctrine\DBAL\Schema\Schema $oldSchema) {
		$comparator = new \Doctrine\DBAL\Schema\Comparator;
		$schemaDiff = $comparator->compare($oldSchema, $newSchema);

		$platform = $this->dataMapper->getDB()->getConn()->getDatabasePlatform();

		$queries = $schemaDiff->toSql($platform);
		foreach($queries as $query)
			$this->dataMapper->getDB()->query($query);
	}
674982
protected function getDropSqlStatementsForExistingSchema(
        Schema $newSchema,
        AbstractPlatform $databasePlatform
    ): array {
        $existingSchema = $this->db->getSchemaManager()->createSchema();
        $statements = [];
        // reverse table order for clean-up (due to FKs)
        $tables = array_reverse($newSchema->getTables());
        // cleanup pre-existing database
        foreach ($tables as $table) {
            if ($existingSchema->hasTable($table->getName())) {
                $statements[] = $databasePlatform->getDropTableSQL($table);
            }
        }

        return $statements;
    }
686167
protected function mergeAnyExtendedSchemas(array $objectSchema, $schemaName)
    {
        if (!(isset($objectSchema['extends']) || isset($objectSchema['extends_default']))) {
            return $objectSchema;
        }

        return $this->mergeSchemaObjectArrays($this->getParentSchemaObject($objectSchema, $schemaName), $objectSchema);
    }
1248741
private function getDroppedViews(Schema $oldSchema, Schema $newSchema)
    {
        $droppedViews = array();

        foreach ($oldSchema->getViews() as $view) {
            if (!$newSchema->hasView($view->getName())
                || $this->compareViews($view, $newSchema->getView($view->getName()))) {
                $droppedViews[] = $view;
            }
        }

        return $droppedViews;
    }
1304450
public function getSchema()
    {
        $backup = array();
        $tables = $this->getTables();
        foreach ($tables as $table) {
            $backup[] = $this->getBackup();
        }
        
        return implode("\n\n", $backup);
    }
25067
protected function getSchemaForEntity(): Schema
    {
        if ($this->entityClass instanceof Schema) {
            return $this->entityClass;
        }

        $model = new $this->entityClass();

        if ($model instanceof ActiveRecord) {
            return $model->getSchema();
        }

        return new DynamicSchema();
    }
185604
protected function dropColumns(array $fields)
    {
        $schema = [];

        foreach($fields as $field)
        {
            $schema[] = $this->dropColumn($field);
        }

        return $schema;
    }
1238724
function schema( $params = array() )
    {
        if ( $this->IsLintChecked )
        {
            return $this->CorrectSchema;
        }

        $params = array_merge( array( 'meta_data' => false,
                                      'format' => 'generic' ),
                               $params );

        $this->CorrectSchema = $this->OtherSchema->schema( $params );
        $this->lintCheckSchema( $this->CorrectSchema );
        $this->IsLintChecked = true;
        return $this->CorrectSchema;
    }
1271666
public function fetchHistory(): array
    {
        if ($this->db->schema->getTableSchema($this->migrationTable, true) === null) {
            return [];
        }

        $rows = (new Query())
            ->select(['version', 'apply_time'])
            ->from($this->migrationTable)
            ->orderBy(['apply_time' => SORT_DESC, 'version' => SORT_DESC])
            ->all($this->db);

        $history = [];

        foreach ($rows as $key => $row) {
            if ($row['version'] === MigrateController::BASE_MIGRATION) {
                continue;
            }

            if (preg_match('/m?(\d{6}_?\d{6})(\D.*)?$/is', $row['version'], $matches)) {
                $row['canonicalVersion'] = str_replace('_', '', $matches[1]);
            } else {
                $row['canonicalVersion'] = $row['version'];
            }

            $row['apply_time'] = (int)$row['apply_time'];

            $history[] = $row;
        }

        usort($history, static function ($a, $b) {
            if ($a['apply_time'] === $b['apply_time']) {
                if (($compareResult = strcasecmp($b['canonicalVersion'], $a['canonicalVersion'])) !== 0) {
                    return $compareResult;
                }

                return strcasecmp($b['version'], $a['version']);
            }

            return ($a['apply_time'] > $b['apply_time']) ? -1 : 1;
        });

        return ArrayHelper::map($history, 'version', 'apply_time');
    }
592225
@Override
    public Schema transform(Schema inputSchema) {
        Schema.Builder newSchema = new Schema.Builder();
        for (int i = 0; i < inputSchema.numColumns(); i++) {
            if (inputSchema.getType(i) == ColumnType.String) {
                newSchema.addColumnDouble(inputSchema.getMetaData(i).getName());
            } else
                newSchema.addColumn(inputSchema.getMetaData(i));

        }
        return newSchema.build();
    }
1034574
public function getTables($schema = null)
    {
        $sql = 'SELECT' . " tbl_name FROM sqlite_master WHERE type = 'table' ORDER BY tbl_name";
        $tables = [];
        foreach ($this->query($sql, [], \PDO::FETCH_ASSOC) as $row) {
            $tables[] = $row['tbl_name'];
        }

        return $tables;
    }