MariaDB Error on upgrade

Frequently if not all the time have issues with HA and upgrading with MariaDB behind part of it. Up until now have been able to “fix” it by clearing all the tables in the DB. That didn’t work this time. I have loads of errors but here is part of one. Any idea how to fix this? I’ve tried clearing all the tables and restarting but still erroring:

2021-04-13 13:36:17 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (MySQLdb._exceptions.IntegrityError) (1364, "Field 'change_id' doesn't have a default value")
[SQL: INSERT INTO schema_changes (schema_version, changed) VALUES (%s, %s)]
[parameters: (13, datetime.datetime(2021, 4, 13, 18, 36, 17, 79155, tzinfo=datetime.timezone.utc))]
(Background on this error at: http://sqlalche.me/e/13/gkpj)
2021-04-13 13:36:17 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup to mysql://hass:<pass>@127.0.0.1/hass?charset=utf8: (MySQLdb._exceptions.IntegrityError) (1364, "Field 'change_id' doesn't have a default value")
[SQL: INSERT INTO schema_changes (schema_version, changed) VALUES (%s, %s)]
[parameters: (13, datetime.datetime(2021, 4, 13, 18, 36, 17, 79155, tzinfo=datetime.timezone.utc))]
(Background on this error at: http://sqlalche.me/e/13/gkpj) (retrying in 3 seconds)
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/local/lib/python3.8/site-packages/MySQLdb/cursors.py", line 206, in execute
    res = self._query(query)
  File "/usr/local/lib/python3.8/site-packages/MySQLdb/cursors.py", line 319, in _query
    db.query(q)
  File "/usr/local/lib/python3.8/site-packages/MySQLdb/connections.py", line 259, in query
    _mysql.connection.query(self, query)
MySQLdb._exceptions.IntegrityError: (1364, "Field 'change_id' doesn't have a default value")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/__init__.py", line 398, in _setup_recorder
    migration.migrate_schema(self)
  File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 38, in migrate_schema
    return
  File "/usr/local/lib/python3.8/contextlib.py", line 120, in __exit__
    next(self.gen)
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 48, in session_scope
    session.commit()
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 1046, in commit
    self.transaction.commit()
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 504, in commit
    self._prepare_impl()
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 483, in _prepare_impl
    self.session.flush()
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 2540, in flush
    self._flush(objects)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/session.py", line 2682, in _flush

Had to manually change change_id column to AUTO_INCREMENT. Not sure why that is but now it’s working.