diff options
| author | MW <joasch@users.sourceforge.net> | 2007-12-07 22:08:18 +0000 |
|---|---|---|
| committer | MW <joasch@users.sourceforge.net> | 2007-12-07 22:08:18 +0000 |
| commit | a5e7bfbfe905d1debfc21e2625fb7fe4455d231a (patch) | |
| tree | ece91dea3c96ff7a3955e2e94a7d93466b3c655e /BitInstaller.php | |
| parent | 9d58419187cab08070a023ff71f981fec3dbceb5 (diff) | |
| download | install-a5e7bfbfe905d1debfc21e2625fb7fe4455d231a.tar.gz install-a5e7bfbfe905d1debfc21e2625fb7fe4455d231a.tar.bz2 install-a5e7bfbfe905d1debfc21e2625fb7fe4455d231a.zip | |
Add missing prefix in case 'CREATESEQUENCE' and better handling of RENAMESEQUENCE to deal with autogenerated sequences that never been triggered or simply missing.
DropSequence now do work w/o error as it been added to BitDbAdodb
Diffstat (limited to 'BitInstaller.php')
| -rw-r--r-- | BitInstaller.php | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/BitInstaller.php b/BitInstaller.php index 7aac8c6..ea21e24 100644 --- a/BitInstaller.php +++ b/BitInstaller.php @@ -1,6 +1,6 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_install/BitInstaller.php,v 1.28 2007/04/21 14:10:41 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_install/BitInstaller.php,v 1.29 2007/12/07 22:08:18 joasch Exp $ * @package install */ @@ -205,20 +205,23 @@ class BitInstaller extends BitSystem { case 'CREATESEQUENCE': foreach( $dd as $create ) { foreach( $create as $sequence ) { - $this->mDb->CreateSequence( $sequence ); + $this->mDb->CreateSequence( $tablePrefix.$sequence ); } } break; case 'RENAMESEQUENCE': foreach( $dd as $rename ) { foreach( $rename as $from => $to ) { - if( $id = $this->mDb->GenID( $from ) ) { - // this causes an error... - //$this->mDb->DropSequence( $from ); - $this->mDb->CreateSequence( $to, $id ); + if( $this->mDb->tableExists( $tablePrefix.$from ) ) { + if( $id = $this->mDb->GenID( $from ) ) { + $this->mDb->DropSequence( $tablePrefix.$from ); + $this->mDb->CreateSequence( $tablePrefix.$to, $id ); + } else { + $errors[] = 'Failed to rename sequence '.$tablePrefix.$from.' to '.$tablePrefix.$to; + $failedcommands[] = implode( " ", $sql ); + } } else { - $errors[] = 'Failed to rename sequence '.$from.' to '.$to; - $failedcommands[] = implode( " ", $sql ); + $this->mDb->CreateSequence( $tablePrefix.$to, $this->mPackages[$package]['sequences'][$to]['start'] ); } } } |
