incubator-zeta-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Suwandi Tanuwijaya (Created) (JIRA)" <>
Subject [jira] [Created] (ZETACOMP-111) Better logic for altering field on SqliteWriter class
Date Sun, 11 Dec 2011 03:24:40 GMT
Better logic for altering field on SqliteWriter class

                 Key: ZETACOMP-111
             Project: Zeta Components
          Issue Type: Improvement
          Components: DatabaseSchema
         Environment: Ubuntu Natty
PHP 5.3.6
            Reporter: Suwandi Tanuwijaya
            Priority: Minor


Just improvement for altering field from create temporary and filled it with just, rename

Here is the code for the improvement on dropField() and changeField() method on ezcDbSchemaSqliteWriter

dropField() and changeField method
            $tmpTableCreateSql = 'ALTER TABLE \''.$tableName.'\' RENAME TO \''.$tmpTableName.'\';';
            $newTableCreateSql = 'CREATE TABLE \''.$tableName.'\' ( '.$fields.' );';
            if( count( $fieldList ) > 0 )
                $db->exec( $tmpTableCreateSql );
                $db->exec( $newTableCreateSql );
                $db->exec( 'INSERT INTO \''.$tableName.'\' SELECT '.implode( ', ', $fieldList
).' FROM \''.$tmpTableName.'\';' );
                $db->exec( 'DROP TABLE \''.$tmpTableName.'\';' );
            // and so on

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message