Add Postgresql warning when using CREATE INDEX without CONCURRENTLY keyword

This commit is contained in:
David Wobrock committed 2021-06-19 18:15:40 +02:00
1 parent 9ea8872a29
commit 343d163c88
3 files changed
+31 -4

No files matched your search

@@ -1,5 +1,16 @@
import re
from .base import BaseAnalyser
class PostgresqlAnalyser(BaseAnalyser):
migration_tests = []
migration_tests = [
{
"code": "CREATE_INDEX",
"fn": lambda sql, **kw: re.search("CREATE (UNIQUE )?INDEX", sql)
and not re.search("INDEX CONCURRENTLY", sql),
"msg": "CREATE INDEX locks table",
"mode": "one_liner",
"type": "warning",
},
]