* Fix minimum version to run event_id_post_migration
The table rebuild to fix the foreign key constraint was added
in https://github.com/home-assistant/core/pull/120779 but the
schema version was not bumped so we need to make sure
any database that was created with schema 43 or older
still has the migration run as otherwise they will not
be able to purge the database with SQLite since each
delete in the events table will due a full table scan
of the states table to look for a foreign key that is
not there
fixes#138818
* Apply suggestions from code review
* Update homeassistant/components/recorder/migration.py
* Update homeassistant/components/recorder/migration.py
* Update homeassistant/components/recorder/const.py
* Apply suggestions from code review
* Apply suggestions from code review
* Apply suggestions from code review
* Apply suggestions from code review
* update tests, add more cover
* update tests, add more cover
* Update tests/components/recorder/test_migration_run_time_migrations_remember.py
* Ensure indices needed by data migrators exist
* Update test
* Improve test
* Ignore index error on char(0) columns
* Adjust tests
* Address review comments
* Add comment motivating magic number
* FIX: make "year" period work in leap year
* Add test
* Set second and microsecond to non-zero in test start times
* FIX: better fix for leap year problem
* Revert "FIX: better fix for leap year problem"
This reverts commit 06aba46ec6.
---------
Co-authored-by: Erik <erik@montnemery.com>
* Improve recorder history queries
* Remove some comments
* Update StatesManager._oldest_ts when adding pending state
* Update after review
* Improve tests
* Improve post-purge logic
* Avoid calling dt_util.utc_to_timestamp in new code
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
* area conversions
* start work on tests
* add number device class
* update unit conversions to utilise distance constants
* add area unit
* update test unit system
* update device condition and trigger
* update statistic unit converters
* further tests work WIP
* update test unit system
* add missing string translations
* fix websocket tests
* add deprecated notice
* add more missing strings and missing initialisation of unit system
* adjust icon and remove strings from scrape and random
* Fix acre to meters conversion
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* Tidy up valid units
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* fix ordering of area
* update order alphabetically
* fix broken test
* update test_init
* Update homeassistant/const.py
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* remove deprecated unit and fix alphabetical order
* change deprecation and add tests, change to millimeter conversion for inches
* fix order
* re-order defs alphabetically
* add measurement as well
* update icons
* fix up Deprecation of area square meters
* Update core integrations to UnitOfArea
* update test recorder tests
* unit system tests in alphabetical
* update snapshot
* rebuild
* revert alphabetization of functions
* other revert of alphabetical order
---------
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* Make statistics validation create issue registry issues
* Disable creating issue about outdated MariaDB version in tests
* Use call_soon_threadsafe instead of run_callback_threadsafe
* Update tests
* Fix flapping test
* Disable creating issue about outdated SQLite version in tests
* Implement agreed changes
* Add translation strings for issue titles
* Update test