Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
Ubuntu Natty
PHP 5.3.6
Sqlite
Description
Hi,
Just improvement for altering field from create temporary and filled it with just, rename it.
Here is the code for the improvement on dropField() and changeField() method on ezcDbSchemaSqliteWriter class:
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
...
}}}