From be4e9f91b62b4f64e207b389796cd864428bb26b Mon Sep 17 00:00:00 2001
From: Erik Montnemery <erik@montnemery.com>
Date: Thu, 4 Nov 2021 16:34:35 +0100
Subject: [PATCH] Change minimum supported SQLite version to 3.31.0 (#59073)

---
 homeassistant/components/recorder/util.py |  4 ++--
 tests/components/recorder/test_util.py    | 14 +++++---------
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/homeassistant/components/recorder/util.py b/homeassistant/components/recorder/util.py
index b4bbce27130..6c53347a536 100644
--- a/homeassistant/components/recorder/util.py
+++ b/homeassistant/components/recorder/util.py
@@ -49,7 +49,7 @@ MIN_VERSION_MARIA_DB_ROWNUM = AwesomeVersion("10.2.0", AwesomeVersionStrategy.SI
 MIN_VERSION_MYSQL = AwesomeVersion("8.0.0", AwesomeVersionStrategy.SIMPLEVER)
 MIN_VERSION_MYSQL_ROWNUM = AwesomeVersion("5.8.0", AwesomeVersionStrategy.SIMPLEVER)
 MIN_VERSION_PGSQL = AwesomeVersion("12.0", AwesomeVersionStrategy.SIMPLEVER)
-MIN_VERSION_SQLITE = AwesomeVersion("3.32.1", AwesomeVersionStrategy.SIMPLEVER)
+MIN_VERSION_SQLITE = AwesomeVersion("3.31.0", AwesomeVersionStrategy.SIMPLEVER)
 MIN_VERSION_SQLITE_ROWNUM = AwesomeVersion("3.25.0", AwesomeVersionStrategy.SIMPLEVER)
 
 # This is the maximum time after the recorder ends the session
@@ -295,7 +295,7 @@ def _warn_unsupported_dialect(dialect):
         "Starting with Home Assistant 2022.2 this will prevent the recorder from "
         "starting. Please migrate your database to a supported software before then",
         dialect,
-        "MariaDB ≥ 10.3, MySQL ≥ 8.0, PostgreSQL ≥ 12, SQLite ≥ 3.32.1",
+        "MariaDB ≥ 10.3, MySQL ≥ 8.0, PostgreSQL ≥ 12, SQLite ≥ 3.31.0",
     )
 
 
diff --git a/tests/components/recorder/test_util.py b/tests/components/recorder/test_util.py
index da88d17f02a..940925c48ca 100644
--- a/tests/components/recorder/test_util.py
+++ b/tests/components/recorder/test_util.py
@@ -364,20 +364,16 @@ def test_supported_pgsql(caplog, pgsql_version):
     "sqlite_version,message",
     [
         (
-            "3.32.0",
-            "Version 3.32.0 of SQLite is not supported; minimum supported version is 3.32.1.",
-        ),
-        (
-            "3.31.0",
-            "Version 3.31.0 of SQLite is not supported; minimum supported version is 3.32.1.",
+            "3.30.0",
+            "Version 3.30.0 of SQLite is not supported; minimum supported version is 3.31.0.",
         ),
         (
             "2.0.0",
-            "Version 2.0.0 of SQLite is not supported; minimum supported version is 3.32.1.",
+            "Version 2.0.0 of SQLite is not supported; minimum supported version is 3.31.0.",
         ),
         (
             "dogs",
-            "Version dogs of SQLite is not supported; minimum supported version is 3.32.1.",
+            "Version dogs of SQLite is not supported; minimum supported version is 3.31.0.",
         ),
     ],
 )
@@ -410,7 +406,7 @@ def test_warn_outdated_sqlite(caplog, sqlite_version, message):
 @pytest.mark.parametrize(
     "sqlite_version",
     [
-        ("3.32.1"),
+        ("3.31.0"),
         ("3.33.0"),
     ],
 )