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
cfaa5f12
Commit
cfaa5f12
authored
Jul 23, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
23025b58
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
Sqlite.php
lib/Doctrine/Export/Sqlite.php
+13
-1
Table.php
lib/Doctrine/Table.php
+20
-1
No files found.
lib/Doctrine/Export/Sqlite.php
View file @
cfaa5f12
...
...
@@ -180,7 +180,19 @@ class Doctrine_Export_Sqlite extends Doctrine_Export
}
$name
=
$this
->
conn
->
quoteIdentifier
(
$name
,
true
);
$query
[]
=
'CREATE TABLE '
.
$name
.
' ('
.
$queryFields
.
')'
;
$sql
=
'CREATE TABLE '
.
$name
.
' ('
.
$queryFields
.
')'
;
if
(
$check
=
$this
->
getCheckDeclaration
(
$fields
))
{
$sql
.=
', '
.
$check
;
}
if
(
isset
(
$options
[
'checks'
])
&&
$check
=
$this
->
getCheckDeclaration
(
$options
[
'checks'
]))
{
$sql
.=
', '
.
$check
;
}
$sql
.=
')'
;
$query
[]
=
$sql
;
if
(
isset
(
$options
[
'indexes'
])
&&
!
empty
(
$options
[
'indexes'
]))
{
foreach
(
$options
[
'indexes'
]
as
$index
=>
$definition
)
{
...
...
lib/Doctrine/Table.php
View file @
cfaa5f12
...
...
@@ -121,7 +121,9 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
*
* -- foreignKeys the foreign keys of this table
*
* -- collation
* -- checks the check constraints of this table, eg. 'price > dicounted_price'
*
* -- collation collation attribute
*
* -- indexes the index definitions of this table
*
...
...
@@ -468,6 +470,23 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
{
$this
->
options
[
'foreignKeys'
][]
=
$definition
;
}
/**
* addCheckConstraint
*
* adds a check constraint to this table
*
* @return void
*/
public
function
addCheckConstraint
(
$definition
,
$name
)
{
if
(
is_string
(
$name
))
{
$this
->
options
[
'checks'
][
$name
]
=
$definition
;
}
else
{
$this
->
options
[
'checks'
][]
=
$definition
;
}
return
$this
;
}
/**
* addIndex
*
...
...
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