This commit is contained in:
parent
997d066f02
commit
0c560d73f9
@ -502,16 +502,26 @@ class Doctrine_Export_Firebird extends Doctrine_Export
|
|||||||
* 'charset' => 'utf8',
|
* 'charset' => 'utf8',
|
||||||
* 'collate' => 'utf8_unicode_ci',
|
* 'collate' => 'utf8_unicode_ci',
|
||||||
* );
|
* );
|
||||||
* @return string
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function createSequence($seqName, $start = 1, array $options = array())
|
public function createSequence($seqName, $start = 1, array $options = array())
|
||||||
{
|
{
|
||||||
$sequenceName = $this->conn->formatter->getSequenceName($seqName);
|
$sequenceName = $this->conn->formatter->getSequenceName($seqName);
|
||||||
|
|
||||||
$this->conn->exec('CREATE GENERATOR ' . $sequenceName);
|
$this->conn->exec('CREATE GENERATOR ' . $sequenceName);
|
||||||
|
|
||||||
|
try {
|
||||||
$this->conn->exec('SET GENERATOR ' . $sequenceName . ' TO ' . ($start-1));
|
$this->conn->exec('SET GENERATOR ' . $sequenceName . ' TO ' . ($start-1));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} catch (Doctrine_Connection_Exception $e) {
|
||||||
|
try {
|
||||||
$this->dropSequence($seqName);
|
$this->dropSequence($seqName);
|
||||||
|
} catch(Doctrine_Connection_Exception $e) {
|
||||||
|
throw new Doctrine_Export_Exception('Could not drop inconsistent sequence table');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new Doctrine_Export_Exception('could not create sequence table');
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* drop existing sequence
|
* drop existing sequence
|
||||||
|
@ -293,6 +293,7 @@ class Doctrine_Export_Sqlite extends Doctrine_Export
|
|||||||
return true;
|
return true;
|
||||||
} catch(Doctrine_Connection_Exception $e) {
|
} catch(Doctrine_Connection_Exception $e) {
|
||||||
// Handle error
|
// Handle error
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$result = $db->exec('DROP TABLE ' . $sequenceName);
|
$result = $db->exec('DROP TABLE ' . $sequenceName);
|
||||||
} catch(Doctrine_Connection_Exception $e) {
|
} catch(Doctrine_Connection_Exception $e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user