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
b117b468
Commit
b117b468
authored
Mar 27, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed mysql foreign key issue
parent
0770450d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
1 deletion
+46
-1
Mysql.php
lib/Doctrine/Export/Mysql.php
+46
-1
No files found.
lib/Doctrine/Export/Mysql.php
View file @
b117b468
...
...
@@ -91,7 +91,52 @@ class Doctrine_Export_Mysql extends Doctrine_Export
*
* @return void
*/
public
function
createTableSql
(
$name
,
array
$fields
,
array
$options
=
array
())
{
public
function
createTable
(
$name
,
array
$fields
,
array
$options
=
array
())
{
$sql
=
$this
->
createTableSql
(
$name
,
$fields
,
$options
);
$this
->
conn
->
exec
(
'SET FOREIGN_KEY_CHECKS = 0'
);
$this
->
conn
->
execute
(
$sql
);
$this
->
conn
->
exec
(
'SET FOREIGN_KEY_CHECKS = 1'
);
}
/**
* create a new table
*
* @param string $name Name of the database that should be created
* @param array $fields Associative array that contains the definition of each field of the new table
* The indexes of the array entries are the names of the fields of the table an
* the array entry values are associative arrays like those that are meant to be
* passed with the field definitions to get[Type]Declaration() functions.
* array(
* 'id' => array(
* 'type' => 'integer',
* 'unsigned' => 1
* 'notnull' => 1
* 'default' => 0
* ),
* 'name' => array(
* 'type' => 'text',
* 'length' => 12
* ),
* 'password' => array(
* 'type' => 'text',
* 'length' => 12
* )
* );
* @param array $options An associative array of table options:
* array(
* 'comment' => 'Foo',
* 'charset' => 'utf8',
* 'collate' => 'utf8_unicode_ci',
* 'type' => 'innodb',
* );
*
* @return void
*/
public
function
createTableSql
(
$name
,
array
$fields
,
array
$options
=
array
())
{
if
(
!
$name
)
throw
new
Doctrine_Export_Exception
(
'no valid table name specified'
);
...
...
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