2016-03-19 19:15:09 +08:00
|
|
|
from django.db import connections
|
|
|
|
|
|
|
|
from . import Tags, register
|
|
|
|
|
|
|
|
|
|
|
|
@register(Tags.database)
|
2020-02-07 15:46:13 +08:00
|
|
|
def check_database_backends(databases=None, **kwargs):
|
|
|
|
if databases is None:
|
|
|
|
return []
|
2016-03-19 19:15:09 +08:00
|
|
|
issues = []
|
2020-02-07 15:46:13 +08:00
|
|
|
for alias in databases:
|
|
|
|
conn = connections[alias]
|
2016-03-19 19:15:09 +08:00
|
|
|
issues.extend(conn.validation.check(**kwargs))
|
|
|
|
return issues
|