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
ca6a1387
Commit
ca6a1387
authored
Jun 13, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
deef2137
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
4 deletions
+36
-4
Mysql.php
lib/Doctrine/Export/Mysql.php
+36
-4
No files found.
lib/Doctrine/Export/Mysql.php
View file @
ca6a1387
...
...
@@ -377,22 +377,54 @@ class Doctrine_Export_Mysql extends Doctrine_Export
* create sequence
*
* @param string $sequenceName name of the sequence to be created
* @param string $seqcol_name the name of the sequence column
* @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',
* 'type' => 'innodb',
* );
* @return boolean
*/
public
function
createSequence
(
$sequenceName
,
$start
=
1
)
public
function
createSequence
(
$sequenceName
,
$start
=
1
,
array
$options
=
array
()
)
{
$sequenceName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getSequenceName
(
$sequenceName
),
true
);
$seqcolName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_SEQCOL_NAME
),
true
);
$optionsStrings
=
array
();
if
(
isset
(
$options
[
'comment'
])
&&
!
empty
(
$options
[
'comment'
]))
{
$optionsStrings
[
'comment'
]
=
'COMMENT = '
.
$this
->
conn
->
quote
(
$options
[
'comment'
],
'string'
);
}
if
(
isset
(
$options
[
'charset'
])
&&
!
empty
(
$options
[
'charset'
]))
{
$optionsStrings
[
'charset'
]
=
'DEFAULT CHARACTER SET '
.
$options
[
'charset'
];
if
(
isset
(
$options
[
'collate'
]))
{
$optionsStrings
[
'collate'
]
.=
' COLLATE '
.
$options
[
'collate'
];
}
}
$type
=
false
;
if
(
isset
(
$options
[
'type'
]))
{
$type
=
$options
[
'type'
];
}
else
{
$type
=
$this
->
conn
->
default_table_type
;
}
if
(
$type
)
{
$optionsStrings
[]
=
'ENGINE = '
.
$type
;
}
try
{
$query
=
'CREATE TABLE '
.
$sequenceName
.
' ('
.
$seqcolName
.
' INT NOT NULL AUTO_INCREMENT, PRIMARY KEY ('
.
$seqcolName
.
'))'
.
strlen
(
$this
->
conn
->
default_table_type
)
?
' TYPE = '
.
$this
->
conn
->
default_table_type
:
''
;
$res
=
$this
->
conn
->
exec
(
$query
);
}
catch
(
Doctrine_Connection_Exception
$e
)
{
throw
new
Doctrine_Export_Exception
(
'could not create sequence table'
);
...
...
@@ -577,7 +609,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
* @param array $definition
* @return string
*/
public
function
getAdvancedForeignKeyOptions
(
$definition
)
public
function
getAdvancedForeignKeyOptions
(
array
$definition
)
{
$query
=
''
;
if
(
!
empty
(
$definition
[
'match'
]))
{
...
...
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