Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions framework/src/play/test/Fixtures.java
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ private static void disableForeignKeyConstraints() {
DB.execute("begin\n"
+ "for i in (select constraint_name, table_name from user_constraints where constraint_type ='R'\n"
+ "and status = 'ENABLED') LOOP\n"
+ "execute immediate 'alter table '||i.table_name||' disable constraint '||i.constraint_name||'';\n"
+ "execute immediate 'alter table \"'||i.table_name||'\" disable constraint '||i.constraint_name||'';\n"
+ "end loop;\n"
+ "end;"
);
Expand Down Expand Up @@ -579,8 +579,10 @@ private static void disableForeignKeyConstraints() {
// Then we disable all foreign keys
Statement exec = connection.createStatement();
try {
for (String tableName : names)
exec.addBatch("ALTER TABLE " + tableName + " NOCHECK CONSTRAINT ALL");
for (String tableName : names) {
if (tableName.startsWith("trace_xe_")) continue;
exec.addBatch("ALTER TABLE \"" + tableName + "\" NOCHECK CONSTRAINT ALL");
}
exec.executeBatch();
}
finally {
Expand All @@ -602,7 +604,7 @@ private static void enableForeignKeyConstraints() {
DB.execute("begin\n"
+ "for i in (select constraint_name, table_name from user_constraints where constraint_type ='R'\n"
+ "and status = 'DISABLED') LOOP\n"
+ "execute immediate 'alter table '||i.table_name||' enable constraint '||i.constraint_name||'';\n"
+ "execute immediate 'alter table \"'||i.table_name||'\" enable constraint '||i.constraint_name||'';\n"
+ "end loop;\n"
+ "end;"
);
Expand Down