Upgrade from 38.1 to 40.1

Getting a migration failure of the datebase.
Had an issue where it stated the tables were locked and I used the option to unlock (from log suggestion).

Here are the logs:

2021-07-15 06:54:57,987 INFO db.setup :: Setting up Liquibase...
2021-07-15 06:54:58,089 INFO db.setup :: Liquibase is ready.
2021-07-15 06:54:58,092 INFO db.liquibase :: Checking if Database has unrun migrations...
2021-07-15 06:55:04,410 INFO db.liquibase :: Database has unrun migrations. Waiting for migration lock to be cleared...
2021-07-15 06:55:04,481 INFO db.liquibase :: Migration lock is cleared. Running migrations...
2021-07-15 06:55:04,761 ERROR changelog.ChangeSet :: Change Set migrations/000_migrations.yaml::308::howonlee failed. Error: (conn=135) Duplicate column name 'cache_hit' [Failed SQL: ALTER TABLE metabase.query_execution ADD cache_hit BIT(1) NULL COMMENT 'Cache hit on query execution']
2021-07-15 06:55:04,770 WARN metabase.util :: auto-retry metabase.db.liquibase$migrate_up_if_needed_BANG_$fn__35458@6502198d: Migration failed for change set migrations/000_migrations.yaml::308::howonlee:
Reason: liquibase.exception.DatabaseException: (conn=135) Duplicate column name 'cache_hit' [Failed SQL: ALTER TABLE metabase.query_execution ADD cache_hit BIT(1) NULL COMMENT 'Cache hit on query execution']
2021-07-15 06:55:04,996 ERROR changelog.ChangeSet :: Change Set migrations/000_migrations.yaml::308::howonlee failed. Error: (conn=135) Duplicate column name 'cache_hit' [Failed SQL: ALTER TABLE metabase.query_execution ADD cache_hit BIT(1) NULL COMMENT 'Cache hit on query execution']
2021-07-15 06:55:05,002 WARN metabase.util :: auto-retry metabase.db.liquibase$migrate_up_if_needed_BANG_$fn__35458@6502198d: Migration failed for change set migrations/000_migrations.yaml::308::howonlee:
Reason: liquibase.exception.DatabaseException: (conn=135) Duplicate column name 'cache_hit' [Failed SQL: ALTER TABLE metabase.query_execution ADD cache_hit BIT(1) NULL COMMENT 'Cache hit on query execution']
2021-07-15 06:55:05,164 ERROR changelog.ChangeSet :: Change Set migrations/000_migrations.yaml::308::howonlee failed. Error: (conn=135) Duplicate column name 'cache_hit' [Failed SQL: ALTER TABLE metabase.query_execution ADD cache_hit BIT(1) NULL COMMENT 'Cache hit on query execution']
2021-07-15 06:55:05,168 WARN metabase.util :: auto-retry metabase.db.liquibase$migrate_up_if_needed_BANG_$fn__35458@6502198d: Migration failed for change set migrations/000_migrations.yaml::308::howonlee:
Reason: liquibase.exception.DatabaseException: (conn=135) Duplicate column name 'cache_hit' [Failed SQL: ALTER TABLE metabase.query_execution ADD cache_hit BIT(1) NULL COMMENT 'Cache hit on query execution']
2021-07-15 06:55:05,384 ERROR changelog.ChangeSet :: Change Set migrations/000_migrations.yaml::308::howonlee failed. Error: (conn=135) Duplicate column name 'cache_hit' [Failed SQL: ALTER TABLE metabase.query_execution ADD cache_hit BIT(1) NULL COMMENT 'Cache hit on query execution']
2021-07-15 06:55:05,417 ERROR metabase.core :: Metabase Initialization FAILED
liquibase.exception.MigrationFailedException: Migration failed for change set migrations/000_migrations.yaml::308::howonlee:
Reason: liquibase.exception.DatabaseException: (conn=135) Duplicate column name 'cache_hit' [Failed SQL: ALTER TABLE metabase.query_execution ADD cache_hit BIT(1) NULL COMMENT 'Cache hit on query execution']
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:637)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:83)

Fixed myself by altering the table referenced and deleting the column cache_hit.
Allowed Metabase to complete migration.

great! good to know