Skip to content

Commit bc24b03

Browse files
authored
Merge pull request github#8012 from erik-krogh/db-in-upgrade
QL: allow raw db types in upgrade/downgrade scripts
2 parents 2b6d57d + 8c7bf69 commit bc24b03

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ql/ql/src/queries/style/DBTypeInNonLib.ql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010

1111
import ql
1212

13+
/** Gets a folder that may contain raw DB types. */
14+
string folderWithDbTypes() { result = ["lib", "downgrades", "upgrades"] }
15+
1316
from TypeExpr te
1417
where
1518
te.isDBType() and
16-
not te.getLocation().getFile().getAbsolutePath().matches("%/lib/%") and
19+
not te.getLocation().getFile().getAbsolutePath().matches("%/" + folderWithDbTypes() + "/%") and
1720
exists(File f | f.getAbsolutePath().matches("%/lib/%")) and
1821
// it is needed in one case.
1922
not te = any(Class c | c.getName() = "SuppressionScope").getASuperType() and

0 commit comments

Comments
 (0)