Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
658f73f0
Commit
658f73f0
authored
Jan 10, 2008
by
lsmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- use same implementation as MySQL
parent
3cd02740
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
15 deletions
+9
-15
Sqlite.php
lib/Doctrine/Sequence/Sqlite.php
+9
-15
No files found.
lib/Doctrine/Sequence/Sqlite.php
View file @
658f73f0
...
...
@@ -53,31 +53,25 @@ class Doctrine_Sequence_Sqlite extends Doctrine_Sequence
}
catch
(
Doctrine_Connection_Exception
$e
)
{
if
(
$onDemand
&&
$e
->
getPortableCode
()
==
Doctrine
::
ERR_NOSUCHTABLE
)
{
// Since we are creating the sequence on demand
// we know the first id = 1 so initialize the
// sequence at 2
try
{
$result
=
$this
->
conn
->
export
->
createSequence
(
$seqName
,
2
);
$this
->
conn
->
export
->
createSequence
(
$seqName
);
return
$this
->
nextId
(
$seqName
,
false
);
}
catch
(
Doctrine_Exception
$e
)
{
throw
new
Doctrine_Sequence_Exception
(
'on demand sequence '
.
$seqName
.
' could not be created'
);
}
// First ID of a newly created sequence is 1
return
1
;
}
throw
$e
;
}
$value
=
$this
->
conn
->
getDbh
()
->
lastInsertId
();
$value
=
$this
->
lastInsertId
();
if
(
is_numeric
(
$value
))
{
$query
=
'DELETE FROM '
.
$sequenceName
.
' WHERE '
.
$seqcolName
.
' < '
.
$value
;
$this
->
conn
->
exec
(
$query
);
/**
TODO: is the following needed ?
$this->warnings[] = 'nextID: could not delete previous sequence table values from '.$seq_name;
*/
try
{
$this
->
conn
->
exec
(
$query
);
}
catch
(
Doctrine_Exception
$e
)
{
throw
new
Doctrine_Sequence_Exception
(
'could not delete previous sequence table values from '
.
$seqName
);
}
}
return
$value
;
}
...
...
@@ -111,4 +105,4 @@ class Doctrine_Sequence_Sqlite extends Doctrine_Sequence
return
(
int
)
$this
->
conn
->
fetchOne
(
$query
);
}
}
\ No newline at end of file
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment