platform = $platform; } /** * @return list * * @throws Exception */ public function buildSQL(Schema $schema): array { return array_merge( $this->buildNamespaceStatements($schema->getNamespaces()), $this->buildSequenceStatements($schema->getSequences()), $this->buildTableStatements($schema->getTables()), ); } /** * @param list $namespaces * * @return list * * @throws Exception */ private function buildNamespaceStatements(array $namespaces): array { $statements = []; if ($this->platform->supportsSchemas()) { foreach ($namespaces as $namespace) { $statements[] = $this->platform->getCreateSchemaSQL($namespace); } } return $statements; } /** * @param list $tables * * @return list * * @throws Exception */ private function buildTableStatements(array $tables): array { return $this->platform->getCreateTablesSQL($tables); } /** * @param list $sequences * * @return list * * @throws Exception */ private function buildSequenceStatements(array $sequences): array { $statements = []; foreach ($sequences as $sequence) { $statements[] = $this->platform->getCreateSequenceSQL($sequence); } return $statements; } }