src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/writer.php
protected function generateAdditionalDropSequenceStatements( ezcDbSchemaDiff $dbSchemaDiff, ezcDbHandler $db )
    {
        $reader = new ezcDbSchemaOracleReader();
        $schema = $reader->loadFromDb( $db )->getSchema();
        foreach ( $dbSchemaDiff->removedTables as $table => $true )
        {
            foreach ( $schema[$table]->fields as $name => $field )
            {
                if ( $field->autoIncrement !== true )
                {
                    continue;
                }

                $seqName = ezcDbSchemaOracleHelper::generateSuffixCompositeIdentName( $table, $name, "seq" );
                if ( strpos( $seqName, $table ) !== 0 )
                {
                    $this->queries[] = "DROP SEQUENCE \"$seqName\"";
                }
            }
        }
    }
protected function generateAdditionalDropSequenceStatements( ezcDbSchemaDiff $dbSchemaDiff, ezcDbHandler $db )
    {
        $reader = new ezcDbSchemaOracleReader();
        $schema = $reader->loadFromDb( $db )->getSchema();
        foreach ( $dbSchemaDiff->removedTables as $table => $true )
        {
            foreach ( $schema[$table]->fields as $name => $field )
            {
                if ( $field->autoIncrement !== true )
                {
                    continue;
                }

                $seqName = ezcDbSchemaOracleHelper::generateSuffixCompositeIdentName( $table, $name, "seq" );
                if ( strpos( $seqName, $table ) !== 0 )
                {
                    $this->queries[] = "DROP SEQUENCE \"$seqName\"";
                }
            }
        }
    }
protected function generateAdditionalDropSequenceStatements ( ezcDbSchemaDiff $ dbSchemaDiff , ezcDbHandler $ db ) { $ reader = new ezcDbSchemaOracleReader ( ) ; $ schema = $ reader -> loadFromDb ( $ db ) -> getSchema ( ) ; foreach ( $ dbSchemaDiff -> removedTables as $ table => $ true ) { foreach ( $ schema [ $ table ] -> fields as $ name => $ field ) { if ( $ field -> autoIncrement !== true ) { continue ; } $ seqName = ezcDbSchemaOracleHelper :: generateSuffixCompositeIdentName ( $ table , $ name , "seq" ) ; if ( strpos ( $ seqName , $ table ) !== 0 ) { $ this -> queries [ ] = "DROP SEQUENCE \"$seqName\"" ; } } } }
Generate additional drop sequence statements

Some sequences might not be dropped automatically, this method generates
additional DROP SEQUENCE queries for those.

Since Oracle only allows sequence identifiers up to 30 characters
sequences for long table / column names may be shortened. In this case
the sequence name does not started with the table name any more, thus
does not get dropped together with the table automatically.

This method requires a DB connection to check which sequences have been
defined in the database, because the information about fields is not
available otherwise.

@param ezcDbSchemaDiff $dbSchemaDiff
@param ezcDbHandler $db
@return void
Generate additional drop sequence statements