浏览代码

fix(django): enforce mysql strict mode

Nils Wisiol 8 年之前
父节点
当前提交
c4c70e8448
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 3 0
      api-settings.py.default
  2. 3 0
      api/desecapi/settings.py

+ 3 - 0
api-settings.py.default

@@ -23,6 +23,9 @@ DATABASES = {
         #    'CHARSET': 'utf8',
         #    'COLLATION': 'utf8_general_ci',
         #}
+       'OPTIONS': {
+            'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
+        }
     }
 }
 POWERDNS_API = 'http://nslord:8081/api/v1/servers/localhost'

+ 3 - 0
api/desecapi/settings.py

@@ -75,6 +75,9 @@ DATABASES = {
         'TEST': {
             'CHARSET': 'utf8',
             'COLLATION': 'utf8_general_ci',
+        },
+        'OPTIONS': {
+            'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
         }
     },