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
ff630e2a
Commit
ff630e2a
authored
Nov 15, 2012
by
Lukas Kahwe Smith
Committed by
Martin Hasoň
Nov 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for deferred foreign key constraints for in sqlite
parent
cb440e1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
SqlitePlatform.php
lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
+27
-1
No files found.
lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
View file @
ff630e2a
...
...
@@ -301,6 +301,12 @@ class SqlitePlatform extends AbstractPlatform
}
}
if
(
isset
(
$options
[
'unique'
])
&&
!
empty
(
$options
[
'unique'
]))
{
foreach
(
$options
[
'unique'
]
as
$index
=>
$indexDef
)
{
$query
[]
=
$this
->
getCreateIndexSQL
(
$indexDef
,
$name
);
}
}
return
$query
;
}
...
...
@@ -330,7 +336,7 @@ class SqlitePlatform extends AbstractPlatform
public
function
getListTableColumnsSQL
(
$table
,
$currentDatabase
=
null
)
{
$table
=
str_replace
(
"."
,
"__"
,
$table
);
$table
=
str_replace
(
'.'
,
'__'
,
$table
);
return
"PRAGMA table_info(
$table
)"
;
}
...
...
@@ -373,6 +379,25 @@ class SqlitePlatform extends AbstractPlatform
/**
* {@inheritDoc}
*/
public
function
getAdvancedForeignKeyOptionsSQL
(
ForeignKeyConstraint
$foreignKey
)
{
$query
=
parent
::
getAdvancedForeignKeyOptionsSQL
(
$foreignKey
);
if
(
$foreignKey
->
hasOption
(
'deferrable'
)
&&
$foreignKey
->
getOption
(
'deferrable'
)
!==
false
)
{
$query
.=
' DEFERRABLE'
;
}
else
{
$query
.=
' NOT DEFERRABLE'
;
}
if
(
$foreignKey
->
hasOption
(
'deferred'
)
&&
$foreignKey
->
getOption
(
'deferred'
)
!==
false
)
{
$query
.=
' INITIALLY DEFERRED'
;
}
else
{
$query
.=
' INITIALLY IMMEDIATE'
;
}
return
$query
;
}
public
function
supportsIdentityColumns
()
{
return
true
;
...
...
@@ -392,6 +417,7 @@ class SqlitePlatform extends AbstractPlatform
public
function
getTruncateTableSQL
(
$tableName
,
$cascade
=
false
)
{
$tableName
=
str_replace
(
'.'
,
'__'
,
$tableName
);
return
'DELETE FROM '
.
$tableName
;
}
...
...
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