Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
6822aab9
Commit
6822aab9
authored
Jan 24, 2012
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 715870: [Oracle] Related sequences and triggers must be removed when dropping a table
r=mkanat a=LpSolit
parent
99047442
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
Oracle.pm
Bugzilla/DB/Schema/Oracle.pm
+19
-1
No files found.
Bugzilla/DB/Schema/Oracle.pm
View file @
6822aab9
...
...
@@ -371,13 +371,31 @@ sub get_rename_table_sql {
}
if
(
$def
->
{
TYPE
}
=~
/varchar|text/i
&&
$def
->
{
NOTNULL
})
{
push
(
@sql
,
_get_notnull_trigger_ddl
(
$new_name
,
$column
));
push
(
@sql
,
"DROP TRIGGER ${
$
old_name}_${column}"
);
push
(
@sql
,
"DROP TRIGGER ${old_name}_${column}"
);
}
}
return
@sql
;
}
sub
get_drop_table_ddl
{
my
(
$self
,
$name
)
=
@_
;
my
@sql
;
my
@columns
=
$self
->
get_table_columns
(
$name
);
foreach
my
$column
(
@columns
)
{
my
$def
=
$self
->
get_column_abstract
(
$name
,
$column
);
if
(
$def
->
{
TYPE
}
=~
/SERIAL/i
)
{
# If there's a SERIAL column on this table, we also need
# to remove the sequence.
push
(
@sql
,
"DROP SEQUENCE ${name}_${column}_SEQ"
);
}
}
push
(
@sql
,
"DROP TABLE $name CASCADE CONSTRAINTS PURGE"
);
return
@sql
;
}
sub
_get_notnull_trigger_ddl
{
my
(
$table
,
$column
)
=
@_
;
...
...
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