Generate the SQL to drop a table.

@param \Cake\Database\Schema\TableSchema $schema Schema instance
@return array SQL statements to drop a table.
336704
public function dropTableSql(TableSchema $schema)
    {
        $sql = sprintf(
            'DROP TABLE %s',
            $this->_driver->quoteIdentifier($schema->name())
        );

        return [$sql];
    }
453025
private function createTable(Schema $schema)
    {
        $table = $schema->createTable(RdsDeliveryExecutionService::TABLE_NAME);

        $table->addOption("engine", "InnoDB");
        $table->addOption("charset", "utf8");
        $table->addOption("collate", "utf8_unicode_ci");

        $this->createColumns($table);

        /**
         * Create index for the following methods
         * @see RdsDeliveryExecutionService::getExecutionsByDelivery()
         * @see RdsDeliveryExecutionService::getUserExecutions()
         */
        $this->createIndex($table, [
            RdsDeliveryExecutionService::COLUMN_DELIVERY_ID,
            RdsDeliveryExecutionService::COLUMN_USER_ID,
        ]);

        /**
         * Create index for the following methods
         * @see RdsDeliveryExecutionService::getDeliveryExecutionsByStatus()
         */
        $this->createIndex($table, [
            RdsDeliveryExecutionService::COLUMN_USER_ID,
        ]);
    }
1031927
public function destroy($schema, $table=null)
    {
        $mapper = $this->_mapper($schema);
        $table = $table ? $this->_connection($schema)->table($table) : $mapper->table();

        $sequencePool = $this->_connection($schema)->sequencePool();
        $sequencePool->initialize();

        // delete any sequences
        foreach ($schema->properties() as $prop) {
            if (property_exists($prop->type, 'sequence')) {
                $sequencePool->delete($mapper->sequenceName($prop));
            }
        }

        // destory the table
        $table->dropIfExists();

        return $this;
    }
520183
public function getTables($schema = null)
    {
        if ($schema) {
            $sql = 'SHOW FULL TABLES FROM `' . $this->_escapeIdentifier($schema) . '` WHERE Table_Type != "VIEW"';
        } else {
            $sql = 'SHOW FULL TABLES WHERE Table_Type != "VIEW"';
        }

        $tables = [];
        foreach ($this->query($sql, [], \PDO::FETCH_NUM) as $row) {
            $tables[] = $row[0];
        }

        return $tables;
    }
379982
protected function _generateMetaColumnsSQL($table, $schema)
	{
		if ($schema) {
			return sprintf($this->metaColumnsSQL1, $table, $table, $table, $schema);
		}
		else {
			return sprintf($this->metaColumnsSQL, $table, $table, $schema);
		}
	}
1304137
function GetSchema()
	{
		$this->Connection->Connect();
		
		$schema = new DBSchema($this);
		
		$this->Connection->Disconnect();
		
		return $schema;
	}
928541
def DropTables(self):
    """"""

    rows, _ = self.ExecuteQuery(
        "SELECT table_name FROM information_schema.tables "
        "WHERE table_schema='%s'" % self.database_name)
    for row in rows:
      self.ExecuteQuery("DROP TABLE `%s`" % row["table_name"])
371898
protected function generateSchemaAsSql()
    {
        $prefix = ezcDbSchema::$options->tableNamePrefix;
        foreach ( $this->schema as $tableName => $tableDefinition )
        {
            $this->generateDropTableSql( $prefix . $tableName );
            $this->generateCreateTableSql( $prefix . $tableName, $tableDefinition );
        }
    }
464298
public function getIndexes($table, $schema = null)
    {
        $select = [
            'columns.column_name',
            'pg_class2.relname AS index_type'
        ];
        
        $where = [
            "pg_attribute.attrelid = pg_class1.oid AND pg_class1.relname='".$table."'",
            'columns.column_name = pg_attribute.attname AND columns.table_name=pg_class1.relname',
            'pg_class1.oid = pg_index.indrelid AND pg_attribute.attnum = ANY(pg_index.indkey)',
            'pg_class2.oid = pg_index.indexrelid'
        ];
        
        if ($schema) {
            $where[1] .= ' AND columns.table_schema="'.$schema.'"';
        }
        
        $query = $this
            ->getSelectQuery($select)
            ->from('pg_attribute')
            ->innerJoin('pg_class AS pg_class1', $where[0], false)
            ->innerJoin('information_schema.COLUMNS    AS columns', $where[1], false)
            ->innerJoin('pg_index', $where[2], false)
            ->innerJoin('pg_class AS pg_class2', $where[3], false)
            ->getQuery();
            
        return $this->query($query);
    }
595246
public function dropTable($table)
    {
        $table = $this->buildRealTableName($table);
        $sql = $this->getSchema()->getDropTableSql($table);
        $ret = $this->query($sql);
        return $ret;
    }
522233
public function execute(Schema $schema)
    {
        $tables = $this->getSchemaTables();
        $instance = $this->getInstance();
        foreach ($tables as $table) {
            $columns = $this->getTableColumns($table['name']);
            $this->parseProperty($table['name'], $table['comment'], $columns, $schema, $instance);
        }
    }
453869
public function ApplyRulesBySchema($Schema) {
      $this->_Schema = $Schema->Fetch();
      foreach($this->_Schema as $Field => $Properties) {
         // Create an array to hold rules for this field
         $RuleNames = array();

         if ($Properties->AutoIncrement === TRUE) {
            // Skip all rules for auto-incrementing integer columns - they will
         // not be inserted or updated.
         } else {
            // Force non-null fields without defaults to be required.
            if ($Properties->AllowNull === FALSE && $Properties->Default == '') {
               $RuleNames[] = 'Required';
               $this->_RequiredSchemaFields[] = $Field;
            }

            // Force other constraints based on field type.
            switch($Properties->Type) {
               case 'bit':
               case 'bool':
               case 'boolean':
                  $RuleNames[] = 'Boolean';
                  break;

               case 'tinyint':
               case 'smallint':
               case 'mediumint':
               case 'int':
               case 'integer':
               case 'bigint':
                  $RuleNames[] = 'Integer';
                  break;

               case 'double':
               case 'float':
               case 'real':
               case 'decimal':
               case 'dec':
               case 'numeric':
               case 'fixed':
                  $RuleNames[] = 'Decimal';
                  break;

               case 'date':
               case 'datetime':
                  $RuleNames[] = 'Date';
                  break;
               case 'time':
                  $RuleNames[] = 'Time';
                  break;
               case 'year':
                  $RuleNames[] = 'Year';
                  break;
               case 'timestamp':
                  $RuleNames[] = 'Timestamp';
                  break;

               case 'char':
               case 'varchar':
               case 'tinyblob':
               case 'blob':
               case 'mediumblob':
               case 'longblob':
               case 'tinytext':
               case 'mediumtext':
               case 'text':
               case 'longtext':
               case 'binary':
               case 'varbinary':
                  if ($Properties->Length != '')
                     $RuleNames[] = 'Length';
                  break;

               case 'enum':
               case 'set':
                  $RuleNames[] = 'Enum';
                  break;
            }
            
            if ($Field == 'Format') {
               $RuleNames[] = 'Format';
            }
         }
         // Assign the rules to the field.
         // echo '<div>Field: '.$Field.'</div>';
         // print_r($RuleNames);
         $this->_ApplyRule($Field, $RuleNames);
      }
   }
471076
public function getDropDatabaseSQL()
    {
        $sm     = $this->em->getConnection()->getSchemaManager();
        $schema = $sm->createSchema();

        $visitor = new DropSchemaSqlCollector($this->platform);
        $schema->visit($visitor);

        return $visitor->getQueries();
    }
810840
public function upgradeSchema(Schema $schema)
    {
        /* Add query log db table */

        try {
            $table = $schema->getTable('SystemDatabaseQueryLog');
        } catch (Exception $e) {
            $table = null;
        }
        if (!($table instanceof Table)) {
            $ql = $schema->createTable('SystemDatabaseQueryLog');
            $ql->addColumn('query', 'text');
            $ql->addColumn('params', 'text', ['notnull' => false]);
            $ql->addColumn('executionMS', 'string');
        }
    }
1038327
protected function getColumnCreate(array $schema, string $tableName, string $columnName): array
    {
        $columns = $schema['tables'][$tableName]['columns'];
        $columnData = $columns[$columnName];
        $phinxType = $this->getPhinxColumnType($columnData);
        $columnAttributes = $this->getPhinxColumnOptions($phinxType, $columnData, $columns);

        return [$tableName, $columnName, $phinxType, $columnAttributes];
    }
703472
protected static function createQueueTable(Schema $schema)
    {
        $table = $schema->createTable('bernard_queues');
        $table->addColumn('name', 'string');
        $table->setPrimaryKey(['name']);
    }
185050
public function getDropTableSql($table)
    {
        $table = $this->buildRealTableName($table);
        return $this->getSchema()->getDropTableSql($table);
    }