Skip to content

Commit

Permalink
feat(OracleGrammar): Add dropAllObjects and migrate fresh support
Browse files Browse the repository at this point in the history
  • Loading branch information
elpete committed Oct 4, 2019
1 parent 719e264 commit 7fe3429
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions models/Grammars/OracleGrammar.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,17 @@ component extends="qb.models.Grammars.BaseGrammar" singleton {
return sql;
}

function compileDropAllObjects() {
return [
'BEGIN
FOR c IN (SELECT table_name FROM user_tables) LOOP
EXECUTE IMMEDIATE (''DROP TABLE "'' || c.table_name || ''" CASCADE CONSTRAINTS'');
END LOOP;
FOR s IN (SELECT sequence_name FROM user_sequences) LOOP
EXECUTE IMMEDIATE (''DROP SEQUENCE '' || s.sequence_name);
END LOOP;
END;'
];
}

}

0 comments on commit 7fe3429

Please sign in to comment.