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
4b09d95d
Commit
4b09d95d
authored
May 18, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
9b470a64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
20 deletions
+21
-20
Oracle.php
lib/Doctrine/Export/Oracle.php
+21
-20
No files found.
lib/Doctrine/Export/Oracle.php
View file @
4b09d95d
...
...
@@ -333,7 +333,7 @@ END;
case
'rename'
:
break
;
default
:
throw
new
Doctrine_Export_Exception
(
'change type "'
.
$changeName
.
'" not yet supported'
);
throw
new
Doctrine_Export_Exception
(
'change type "'
.
$changeName
.
'" not yet supported'
);
}
}
...
...
@@ -343,41 +343,42 @@ END;
$name
=
$this
->
conn
->
quoteIdentifier
(
$name
,
true
);
if
(
!
empty
(
$changes
[
'add'
])
&&
is_array
(
$changes
[
'add'
]))
{
if
(
!
empty
(
$changes
[
'add'
])
&&
is_array
(
$changes
[
'add'
]))
{
$fields
=
array
();
foreach
(
$changes
[
'add'
]
as
$field
_n
ame
=>
$field
)
{
$fields
[]
=
$this
->
conn
->
getDeclaration
(
$field
[
'type'
],
$field
_n
ame
,
$field
);
foreach
(
$changes
[
'add'
]
as
$field
N
ame
=>
$field
)
{
$fields
[]
=
$this
->
conn
->
getDeclaration
(
$field
[
'type'
],
$field
N
ame
,
$field
);
}
$result
=
$this
->
conn
->
exec
(
"ALTER TABLE
$name
ADD ("
.
implode
(
', '
,
$fields
)
.
')'
);
$result
=
$this
->
conn
->
exec
(
'ALTER TABLE '
.
$name
.
' ADD ('
.
implode
(
', '
,
$fields
)
.
')'
);
}
if
(
!
empty
(
$changes
[
'change'
])
&&
is_array
(
$changes
[
'change'
]))
{
if
(
!
empty
(
$changes
[
'change'
])
&&
is_array
(
$changes
[
'change'
]))
{
$fields
=
array
();
foreach
(
$changes
[
'change'
]
as
$field
_n
ame
=>
$field
)
{
$fields
[]
=
$field
_n
ame
.
' '
.
$this
->
conn
->
getDeclaration
(
$field
[
'definition'
][
'type'
],
''
,
$field
[
'definition'
]);
foreach
(
$changes
[
'change'
]
as
$field
N
ame
=>
$field
)
{
$fields
[]
=
$field
N
ame
.
' '
.
$this
->
conn
->
getDeclaration
(
$field
[
'definition'
][
'type'
],
''
,
$field
[
'definition'
]);
}
$result
=
$this
->
conn
->
exec
(
"ALTER TABLE
$name
MODIFY ("
.
implode
(
', '
,
$fields
)
.
')'
);
$result
=
$this
->
conn
->
exec
(
'ALTER TABLE '
.
$name
.
' MODIFY ('
.
implode
(
', '
,
$fields
)
.
')'
);
}
if
(
!
empty
(
$changes
[
'rename'
])
&&
is_array
(
$changes
[
'rename'
]))
{
foreach
(
$changes
[
'rename'
]
as
$field_name
=>
$field
)
{
$field_name
=
$this
->
conn
->
quoteIdentifier
(
$field_name
,
true
);
$query
=
"ALTER TABLE
$name
RENAME COLUMN
$field_name
TO "
.
$this
->
conn
->
quoteIdentifier
(
$field
[
'name'
]);
if
(
!
empty
(
$changes
[
'rename'
])
&&
is_array
(
$changes
[
'rename'
]))
{
foreach
(
$changes
[
'rename'
]
as
$fieldName
=>
$field
)
{
$query
=
'ALTER TABLE '
.
$name
.
' RENAME COLUMN '
.
$this
->
conn
->
quoteIdentifier
(
$fieldName
,
true
)
.
' TO '
.
$this
->
conn
->
quoteIdentifier
(
$field
[
'name'
]);
$result
=
$this
->
conn
->
exec
(
$query
);
}
}
if
(
!
empty
(
$changes
[
'remove'
])
&&
is_array
(
$changes
[
'remove'
]))
{
if
(
!
empty
(
$changes
[
'remove'
])
&&
is_array
(
$changes
[
'remove'
]))
{
$fields
=
array
();
foreach
(
$changes
[
'remove'
]
as
$field
_n
ame
=>
$field
)
{
$fields
[]
=
$this
->
conn
->
quoteIdentifier
(
$field
_n
ame
,
true
);
foreach
(
$changes
[
'remove'
]
as
$field
N
ame
=>
$field
)
{
$fields
[]
=
$this
->
conn
->
quoteIdentifier
(
$field
N
ame
,
true
);
}
$result
=
$this
->
conn
->
exec
(
"ALTER TABLE
$name
DROP COLUMN "
.
implode
(
', '
,
$fields
));
$result
=
$this
->
conn
->
exec
(
'ALTER TABLE '
.
$name
.
' DROP COLUMN '
.
implode
(
', '
,
$fields
));
}
if
(
!
empty
(
$changes
[
'name'
]))
{
$change
_n
ame
=
$this
->
conn
->
quoteIdentifier
(
$changes
[
'name'
],
true
);
$result
=
$this
->
conn
->
exec
(
"ALTER TABLE
$name
RENAME TO "
.
$change_n
ame
);
if
(
!
empty
(
$changes
[
'name'
]))
{
$change
N
ame
=
$this
->
conn
->
quoteIdentifier
(
$changes
[
'name'
],
true
);
$result
=
$this
->
conn
->
exec
(
'ALTER TABLE '
.
$name
.
' RENAME TO '
.
$changeN
ame
);
}
}
/**
...
...
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