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
1a14aa30
Commit
1a14aa30
authored
Jun 13, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDB2 porting continues
parent
d9678357
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
7 deletions
+46
-7
Pgsql.php
lib/Doctrine/Export/Pgsql.php
+3
-3
Sqlite.php
lib/Doctrine/Export/Sqlite.php
+43
-4
No files found.
lib/Doctrine/Export/Pgsql.php
View file @
1a14aa30
...
@@ -70,13 +70,13 @@ class Doctrine_Export_Pgsql extends Doctrine_Export
...
@@ -70,13 +70,13 @@ class Doctrine_Export_Pgsql extends Doctrine_Export
{
{
$query
=
''
;
$query
=
''
;
if
(
isset
(
$definition
[
'match'
]))
{
if
(
isset
(
$definition
[
'match'
]))
{
$query
.=
' MATCH '
.
$definition
[
'match'
];
$query
.=
' MATCH '
.
$definition
[
'match'
];
}
}
if
(
isset
(
$definition
[
'onUpdate'
]))
{
if
(
isset
(
$definition
[
'onUpdate'
]))
{
$query
.=
' ON UPDATE '
.
$definition
[
'on_update'
];
$query
.=
' ON UPDATE '
.
$definition
[
'on_update'
];
}
}
if
(
isset
(
$definition
[
'onDelete'
]))
{
if
(
isset
(
$definition
[
'onDelete'
]))
{
$query
.=
' ON DELETE '
.
$definition
[
'on_delete'
];
$query
.=
' ON DELETE '
.
$definition
[
'on_delete'
];
}
}
if
(
isset
(
$definition
[
'deferrable'
]))
{
if
(
isset
(
$definition
[
'deferrable'
]))
{
$query
.=
' DEFERRABLE'
;
$query
.=
' DEFERRABLE'
;
...
...
lib/Doctrine/Export/Sqlite.php
View file @
1a14aa30
...
@@ -213,14 +213,53 @@ class Doctrine_Export_Sqlite extends Doctrine_Export
...
@@ -213,14 +213,53 @@ class Doctrine_Export_Sqlite extends Doctrine_Export
throw
$e
;
throw
$e
;
}
}
}
}
/**
* getAdvancedForeignKeyOptions
* Return the FOREIGN KEY query section dealing with non-standard options
* as MATCH, INITIALLY DEFERRED, ON UPDATE, ...
*
* @param array $definition foreign key definition
* @return string
* @access protected
*/
public
function
getAdvancedForeignKeyOptions
(
array
$definition
)
{
$query
=
''
;
if
(
isset
(
$definition
[
'match'
]))
{
$query
.=
' MATCH '
.
$definition
[
'match'
];
}
if
(
isset
(
$definition
[
'onUpdate'
]))
{
$query
.=
' ON UPDATE '
.
$definition
[
'on_update'
];
}
if
(
isset
(
$definition
[
'onDelete'
]))
{
$query
.=
' ON DELETE '
.
$definition
[
'on_delete'
];
}
if
(
isset
(
$definition
[
'deferrable'
]))
{
$query
.=
' DEFERRABLE'
;
}
else
{
$query
.=
' NOT DEFERRABLE'
;
}
if
(
isset
(
$definition
[
'feferred'
]))
{
$query
.=
' INITIALLY DEFERRED'
;
}
else
{
$query
.=
' INITIALLY IMMEDIATE'
;
}
return
$query
;
}
/**
/**
* create sequence
* create sequence
*
*
* @param string $seqName name of the sequence to be created
* @param string $seqName name of the sequence to be created
* @param string $start start value of the sequence; default is 1
* @param string $start start value of the sequence; default is 1
* @param array $options An associative array of table options:
* array(
* 'comment' => 'Foo',
* 'charset' => 'utf8',
* 'collate' => 'utf8_unicode_ci',
* );
* @return boolean
* @return boolean
*/
*/
public
function
createSequence
(
$seqName
,
$start
=
1
)
public
function
createSequence
(
$seqName
,
$start
=
1
,
array
$options
=
array
()
)
{
{
$sequenceName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getSequenceName
(
$seqName
),
true
);
$sequenceName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getSequenceName
(
$seqName
),
true
);
$seqcolName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_SEQCOL_NAME
),
true
);
$seqcolName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_SEQCOL_NAME
),
true
);
...
@@ -248,12 +287,12 @@ class Doctrine_Export_Sqlite extends Doctrine_Export
...
@@ -248,12 +287,12 @@ class Doctrine_Export_Sqlite extends Doctrine_Export
/**
/**
* drop existing sequence
* drop existing sequence
*
*
* @param string
$seq_name
name of the sequence to be dropped
* @param string
$sequenceName
name of the sequence to be dropped
* @return boolean
* @return boolean
*/
*/
public
function
dropSequence
(
$seq
_n
ame
)
public
function
dropSequence
(
$seq
uenceN
ame
)
{
{
$sequenceName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getSequenceName
(
$seq_n
ame
),
true
);
$sequenceName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getSequenceName
(
$sequenceN
ame
),
true
);
return
$this
->
conn
->
exec
(
'DROP TABLE '
.
$sequenceName
);
return
$this
->
conn
->
exec
(
'DROP TABLE '
.
$sequenceName
);
}
}
}
}
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