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
c8ac51e8
Commit
c8ac51e8
authored
Jun 14, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
little bug fixes
parent
e69284cc
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
51 deletions
+31
-51
Firebird.php
lib/Doctrine/Export/Firebird.php
+2
-4
Frontbase.php
lib/Doctrine/Export/Frontbase.php
+14
-18
Mssql.php
lib/Doctrine/Export/Mssql.php
+1
-2
Mysql.php
lib/Doctrine/Export/Mysql.php
+6
-10
Oracle.php
lib/Doctrine/Export/Oracle.php
+1
-10
Pgsql.php
lib/Doctrine/Export/Pgsql.php
+2
-2
Sqlite.php
lib/Doctrine/Export/Sqlite.php
+5
-5
No files found.
lib/Doctrine/Export/Firebird.php
View file @
c8ac51e8
...
...
@@ -403,7 +403,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
* )
* @return void
*/
public
function
createIndex
(
$table
,
$name
,
array
$definition
)
public
function
createIndex
Sql
(
$table
,
$name
,
array
$definition
)
{
$query
=
'CREATE'
;
...
...
@@ -429,9 +429,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
}
$query
.=
' ('
.
implode
(
', '
,
$fields
)
.
')'
;
$result
=
$this
->
conn
->
exec
(
$query
);
// todo: $this->_silentCommit();
return
$result
;
return
$query
;
}
/**
* create a constraint on a table
...
...
lib/Doctrine/Export/Frontbase.php
View file @
c8ac51e8
...
...
@@ -37,39 +37,35 @@ class Doctrine_Export_Frontbase extends Doctrine_Export
* create a new database
*
* @param string $name name of the database that should be created
* @return
boolean
* @return
string
*/
public
function
createDatabase
(
$name
)
public
function
createDatabase
Sql
(
$name
)
{
$name
=
$this
->
conn
->
quoteIdentifier
(
$name
,
true
);
$query
=
'CREATE DATABASE '
.
$name
;
return
$this
->
conn
->
exec
(
$query
);
return
'CREATE DATABASE '
.
$name
;
}
/**
* drop an existing database
*
* @param string $name name of the database that should be dropped
* @return
boolean
* @return
string
*/
public
function
dropDatabase
(
$name
)
public
function
dropDatabase
Sql
(
$name
)
{
$name
=
$this
->
conn
->
quoteIdentifier
(
$name
,
true
);
$query
=
'DELETE DATABASE '
.
$name
;
return
$this
->
conn
->
exec
(
$query
);
return
'DELETE DATABASE '
.
$name
;
}
/**
* drop an existing table
*
* @param object $this->conns database object that is extended by this class
* @param string $name name of the table that should be dropped
* @return
integer
* @return
string
*/
public
function
dropTable
(
$name
)
public
function
dropTable
Sql
(
$name
)
{
$name
=
$this
->
conn
->
quoteIdentifier
(
$name
,
true
);
return
$this
->
conn
->
exec
(
'DROP TABLE '
.
$name
.
' CASCADE'
)
;
return
'DROP TABLE '
.
$name
.
' CASCADE'
;
}
/**
* alter an existing table
...
...
@@ -289,13 +285,13 @@ class Doctrine_Export_Frontbase extends Doctrine_Export
* drop existing sequence
*
* @param string $seqName name of the sequence to be dropped
* @return
boolean
* @return
string
*/
public
function
dropSequence
(
$seqName
)
public
function
dropSequence
Sql
(
$seqName
)
{
$sequenceName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getSequenceName
(
$seqName
),
true
);
return
$this
->
conn
->
exec
(
'DROP TABLE '
.
$sequenceName
.
' CASCADE'
)
;
return
'DROP TABLE '
.
$sequenceName
.
' CASCADE'
;
}
/**
* drop existing index
...
...
@@ -304,11 +300,11 @@ class Doctrine_Export_Frontbase extends Doctrine_Export
* @param string $name name of the index to be dropped
* @return boolean
*/
public
function
dropIndex
(
$table
,
$name
)
public
function
dropIndex
Sql
(
$table
,
$name
)
{
$table
=
$this
->
conn
->
quoteIdentifier
(
$table
,
true
);
$name
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getIndexName
(
$name
),
true
);
return
$this
->
conn
->
exec
(
'ALTER TABLE '
.
$table
.
' DROP INDEX '
.
$name
)
;
return
'ALTER TABLE '
.
$table
.
' DROP INDEX '
.
$name
;
}
}
lib/Doctrine/Export/Mssql.php
View file @
c8ac51e8
...
...
@@ -72,8 +72,7 @@ class Doctrine_Export_Mssql extends Doctrine_Export
public
function
getTemporaryTableQuery
()
{
return
''
;
}
}
/**
* alter an existing table
*
...
...
lib/Doctrine/Export/Mysql.php
View file @
c8ac51e8
...
...
@@ -95,11 +95,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
{
$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
...
...
@@ -615,10 +611,10 @@ class Doctrine_Export_Mysql extends Doctrine_Export
if
(
!
empty
(
$definition
[
'match'
]))
{
$query
.=
' MATCH '
.
$definition
[
'match'
];
}
if
(
!
empty
(
$definition
[
'on
_u
pdate'
]))
{
if
(
!
empty
(
$definition
[
'on
U
pdate'
]))
{
$query
.=
' ON UPDATE '
.
$this
->
getForeignKeyRefentialAction
(
$definition
[
'onUpdate'
]);
}
if
(
!
empty
(
$definition
[
'on
_d
elete'
]))
{
if
(
!
empty
(
$definition
[
'on
D
elete'
]))
{
$query
.=
' ON DELETE '
.
$this
->
getForeignKeyRefentialAction
(
$definition
[
'onDelete'
]);
}
return
$query
;
...
...
@@ -630,11 +626,11 @@ class Doctrine_Export_Mysql extends Doctrine_Export
* @param string $name name of the index to be dropped
* @return void
*/
public
function
dropIndex
(
$table
,
$name
)
public
function
dropIndex
Sql
(
$table
,
$name
)
{
$table
=
$this
->
conn
->
quoteIdentifier
(
$table
,
true
);
$name
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
formatter
->
getIndexName
(
$name
),
true
);
return
$this
->
conn
->
exec
(
'DROP INDEX '
.
$name
.
' ON '
.
$table
)
;
return
'DROP INDEX '
.
$name
.
' ON '
.
$table
;
}
/**
* dropTable
...
...
@@ -643,10 +639,10 @@ class Doctrine_Export_Mysql extends Doctrine_Export
* @throws PDOException
* @return void
*/
public
function
dropTable
(
$table
)
public
function
dropTable
Sql
(
$table
)
{
$table
=
$this
->
conn
->
quoteIdentifier
(
$table
,
true
);
$this
->
conn
->
exec
(
'DROP TABLE '
.
$table
)
;
return
'DROP TABLE '
.
$table
;
}
}
lib/Doctrine/Export/Oracle.php
View file @
c8ac51e8
...
...
@@ -196,7 +196,7 @@ END;
{
$query
=
''
;
if
(
isset
(
$definition
[
'onDelete'
]))
{
$query
.=
' ON DELETE '
.
$definition
[
'on
_d
elete'
];
$query
.=
' ON DELETE '
.
$definition
[
'on
D
elete'
];
}
if
(
isset
(
$definition
[
'deferrable'
]))
{
$query
.=
' DEFERRABLE'
;
...
...
@@ -420,15 +420,6 @@ END;
$result
=
$this
->
conn
->
exec
(
'ALTER TABLE '
.
$name
.
' RENAME TO '
.
$changeName
);
}
}
/**
* getForeignKeyDeferredDeclaration
*
* @return string
*/
public
function
getForeignKeyDeferredDeclaration
(
$deferred
)
{
return
(
$deferred
)
?
'INITIALLY DEFERRED DEFERRABLE'
:
''
;
}
/**
* create sequence
*
...
...
lib/Doctrine/Export/Pgsql.php
View file @
c8ac51e8
...
...
@@ -73,10 +73,10 @@ class Doctrine_Export_Pgsql extends Doctrine_Export
$query
.=
' MATCH '
.
$definition
[
'match'
];
}
if
(
isset
(
$definition
[
'onUpdate'
]))
{
$query
.=
' ON UPDATE '
.
$definition
[
'on
_u
pdate'
];
$query
.=
' ON UPDATE '
.
$definition
[
'on
U
pdate'
];
}
if
(
isset
(
$definition
[
'onDelete'
]))
{
$query
.=
' ON DELETE '
.
$definition
[
'on
_d
elete'
];
$query
.=
' ON DELETE '
.
$definition
[
'on
D
elete'
];
}
if
(
isset
(
$definition
[
'deferrable'
]))
{
$query
.=
' DEFERRABLE'
;
...
...
lib/Doctrine/Export/Sqlite.php
View file @
c8ac51e8
...
...
@@ -249,10 +249,10 @@ class Doctrine_Export_Sqlite extends Doctrine_Export
$query
.=
' MATCH '
.
$definition
[
'match'
];
}
if
(
isset
(
$definition
[
'onUpdate'
]))
{
$query
.=
' ON UPDATE '
.
$definition
[
'on
_u
pdate'
];
$query
.=
' ON UPDATE '
.
$definition
[
'on
U
pdate'
];
}
if
(
isset
(
$definition
[
'onDelete'
]))
{
$query
.=
' ON DELETE '
.
$definition
[
'on
_d
elete'
];
$query
.=
' ON DELETE '
.
$definition
[
'on
D
elete'
];
}
if
(
isset
(
$definition
[
'deferrable'
]))
{
$query
.=
' DEFERRABLE'
;
...
...
@@ -308,11 +308,11 @@ class Doctrine_Export_Sqlite extends Doctrine_Export
* drop existing sequence
*
* @param string $sequenceName name of the sequence to be dropped
* @return
boolean
* @return
string
*/
public
function
dropSequence
(
$sequenceName
)
public
function
dropSequence
Sql
(
$sequenceName
)
{
$sequenceName
=
$this
->
conn
->
quoteIdentifier
(
$this
->
conn
->
getSequenceName
(
$sequenceName
),
true
);
return
$this
->
conn
->
exec
(
'DROP TABLE '
.
$sequenceName
)
;
return
'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