1
0
mirror of https://github.com/elisspace/core.git synced 2026-09-02 01:06:07 +00:00
Files
core/homeassistant/components
moinmoin-sh 337b8d279e Ensure MariaDB/MySQL can be purged and handle states being deleted out from under the recorder (#43610)
* MariaDB doesn't purge #42402

This addresses  home-assistant#42402
Relationships within table "states" and between tables "states" and "events " home-assistant#40467 prevent the purge from working correctly. The database increases w/o any purge.
This proposal sets related indices to NULL and permits deleting of rows.
Further explanations can be found here home-assistant#42402
This proposal also allows to purge the tables "events" and "states" in any order.

* Update models.py

Corrected for Black style requirements

* Update homeassistant/components/recorder/models.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Add the options to foreign key constraints

* purge old states when database gets deleted out from under us

* pylint

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-11-28 08:42:29 -10:00
..
2020-11-28 00:03:36 +00:00
2020-11-24 00:04:19 +00:00
2020-11-27 00:03:57 +00:00
2020-11-11 12:10:09 +01:00
2020-11-27 00:03:57 +00:00
2020-11-18 00:09:55 +00:00
2020-11-25 20:03:56 +01:00
2020-11-11 12:10:09 +01:00
2020-11-26 00:03:15 +00:00
2020-11-25 08:45:15 +01:00
2020-11-24 00:04:19 +00:00
2020-11-25 08:45:15 +01:00
2020-11-27 00:03:57 +00:00
2020-11-12 00:10:58 +00:00
2020-11-21 00:08:32 +00:00
2020-11-05 00:10:11 +00:00
2020-11-25 08:25:09 +01:00
2020-11-11 13:25:22 +01:00
2020-11-15 00:03:48 +00:00
2020-11-26 00:03:15 +00:00
2020-11-24 00:04:19 +00:00
2020-11-24 00:04:19 +00:00
2020-11-15 00:03:48 +00:00
2020-11-24 00:04:19 +00:00
2020-11-24 00:04:19 +00:00
2020-10-22 00:09:52 +00:00
2020-11-04 00:13:14 +00:00
2020-11-25 08:45:15 +01:00
2020-11-03 00:04:39 +00:00
2020-11-15 00:03:48 +00:00
2020-11-15 00:03:48 +00:00
2020-11-21 00:08:32 +00:00
2020-11-26 00:03:15 +00:00
2020-11-04 00:13:14 +00:00
2020-11-12 00:10:58 +00:00
2020-11-15 00:03:48 +00:00
2020-11-03 00:04:39 +00:00
2020-11-20 00:06:26 +00:00
2020-11-27 00:03:57 +00:00
2020-11-21 11:37:41 +01:00
2020-11-21 00:08:32 +00:00
2020-11-26 00:03:15 +00:00
2020-11-11 13:25:22 +01:00
2020-11-21 00:08:32 +00:00
2020-11-24 00:04:19 +00:00
2020-11-21 00:08:32 +00:00
2020-11-21 00:08:32 +00:00
2020-11-19 00:11:12 +00:00
2020-11-07 00:04:02 +00:00
2020-11-24 00:04:19 +00:00
2020-11-14 07:13:37 -10:00
2020-11-11 13:25:22 +01:00
2020-11-21 00:08:32 +00:00
2020-11-27 00:03:57 +00:00
2020-11-16 18:53:42 +01:00
2020-11-25 08:45:15 +01:00
2020-11-25 08:45:15 +01:00
2020-11-21 00:08:32 +00:00
2020-11-16 00:03:40 +00:00
2020-11-11 12:10:09 +01:00
2020-11-22 00:04:54 +00:00
2020-11-15 00:03:48 +00:00
2020-11-27 00:03:57 +00:00
2020-11-24 00:04:19 +00:00
2020-11-03 00:04:39 +00:00
2020-11-07 00:04:02 +00:00
2020-11-18 00:09:55 +00:00
2020-11-19 00:11:12 +00:00
2020-11-24 00:04:19 +00:00
2020-11-27 00:03:57 +00:00
2020-11-10 00:04:21 +00:00
2020-11-19 00:11:12 +00:00
2020-11-07 00:04:02 +00:00
2020-11-11 12:10:09 +01:00
2020-11-21 00:08:32 +00:00
2020-11-27 00:03:57 +00:00
2020-10-25 13:32:41 +01:00
2020-11-07 00:04:02 +00:00
2020-11-15 00:03:48 +00:00
2020-11-27 00:03:57 +00:00
2020-11-24 00:04:19 +00:00
2020-11-07 00:04:02 +00:00
2020-11-05 00:10:11 +00:00
2020-11-11 13:25:22 +01:00
2020-11-27 00:03:57 +00:00
2020-11-27 00:03:57 +00:00
2020-11-24 00:04:19 +00:00
2020-11-25 20:03:56 +01:00
2020-11-24 00:04:19 +00:00
2020-11-27 00:03:57 +00:00
2020-11-18 00:09:55 +00:00
2020-11-03 00:04:39 +00:00
2020-11-18 00:09:55 +00:00
2020-11-27 18:06:15 +01:00
2020-11-26 00:03:15 +00:00
2020-11-24 00:04:19 +00:00
2020-11-26 00:03:15 +00:00
2020-11-03 00:04:39 +00:00
2020-10-23 16:28:21 +02:00
2020-10-20 03:03:35 +02:00
2020-11-25 00:03:05 +00:00
2020-11-24 00:04:19 +00:00
2020-10-29 00:09:16 +00:00
2020-11-11 12:10:09 +01:00
2020-11-21 00:08:32 +00:00
2020-11-22 00:04:54 +00:00
2020-11-24 00:04:19 +00:00
2020-11-03 00:04:39 +00:00
2020-11-24 19:56:39 +01:00
2020-11-11 12:10:09 +01:00
2020-11-26 00:03:15 +00:00
2020-11-24 00:04:19 +00:00
2020-11-10 00:04:21 +00:00
2020-11-19 16:26:44 -10:00
2020-11-11 12:10:09 +01:00
2020-11-27 00:03:57 +00:00
2020-11-28 09:29:16 +01:00
2020-11-09 00:03:23 +00:00
2020-11-25 00:03:05 +00:00
2020-11-10 00:04:21 +00:00
2020-11-10 00:04:21 +00:00
2020-11-11 00:10:27 +00:00
2020-11-18 00:09:55 +00:00
2020-11-11 13:25:22 +01:00
2020-11-05 00:10:11 +00:00
2020-11-25 08:45:15 +01:00
2020-11-22 00:04:54 +00:00
2020-11-27 00:03:57 +00:00
2020-11-22 00:04:54 +00:00
2020-11-22 00:04:54 +00:00
2020-11-19 00:11:12 +00:00
2020-11-24 00:04:19 +00:00
2020-11-27 00:03:57 +00:00
2020-11-27 00:03:57 +00:00
2020-11-07 00:04:02 +00:00
2020-11-11 00:10:27 +00:00
2020-11-15 00:03:48 +00:00
2020-11-11 13:25:22 +01:00
2020-11-15 00:03:48 +00:00
2020-11-08 00:04:05 +00:00
2020-10-23 00:03:04 +00:00
2020-11-27 21:11:57 +01:00
2020-11-21 00:08:32 +00:00
2020-11-25 08:45:15 +01:00
2020-11-24 00:04:19 +00:00
2020-11-21 00:08:32 +00:00
2020-11-12 00:10:58 +00:00
2020-11-24 00:04:19 +00:00
2020-10-22 00:09:52 +00:00
2020-11-08 00:04:05 +00:00
2020-11-02 00:03:44 +00:00
2020-11-26 00:03:15 +00:00
2020-11-27 09:40:06 +01:00
2020-10-22 11:21:15 +02:00
2020-11-22 12:21:27 +01:00
2020-11-24 00:04:19 +00:00
2020-11-11 13:25:22 +01:00
2020-11-24 00:04:19 +00:00
2020-11-24 00:04:19 +00:00
2020-11-07 00:04:02 +00:00
2020-11-26 00:03:15 +00:00
2020-11-23 08:05:22 -05:00
2020-11-12 00:10:58 +00:00
2020-11-19 00:11:12 +00:00
2020-11-11 00:10:27 +00:00
2020-11-28 00:03:36 +00:00
2020-11-26 00:03:15 +00:00
2020-11-16 00:03:40 +00:00
2020-10-22 00:09:52 +00:00
2020-11-12 00:10:58 +00:00
2020-11-21 00:08:32 +00:00
2020-11-11 00:10:27 +00:00
2020-11-27 00:03:57 +00:00
2020-11-27 00:03:57 +00:00
2020-11-27 00:03:57 +00:00
2020-11-11 12:10:09 +01:00
2020-11-24 00:04:19 +00:00
2020-11-12 00:10:58 +00:00
2020-10-21 11:58:07 +02:00
2020-11-11 12:10:09 +01:00
2020-11-24 00:04:19 +00:00
2020-11-22 00:04:54 +00:00
2020-11-18 00:09:55 +00:00
2020-11-27 00:03:57 +00:00
2020-10-31 00:04:15 +00:00
2020-11-21 00:08:32 +00:00
2020-11-24 00:04:19 +00:00
2020-11-11 12:10:09 +01:00
2020-11-06 09:19:27 +01:00
2020-11-24 00:04:19 +00:00
2020-11-11 12:10:09 +01:00
2020-11-12 00:10:58 +00:00
2020-11-24 00:04:19 +00:00
2020-11-24 00:04:19 +00:00
2020-11-26 00:03:15 +00:00
2020-11-11 00:10:27 +00:00
2020-11-16 13:17:58 +01:00
2020-11-15 00:03:48 +00:00
2020-11-03 00:04:39 +00:00
2020-11-27 00:03:57 +00:00
2020-11-24 00:04:19 +00:00
2020-11-27 00:03:57 +00:00
2020-11-25 08:45:15 +01:00
2020-11-15 00:03:48 +00:00
2020-11-27 00:03:57 +00:00
2020-11-25 08:45:15 +01:00
2020-11-11 13:25:22 +01:00
2020-11-27 16:39:44 -05:00
2020-11-18 00:09:55 +00:00
2020-11-11 12:10:09 +01:00