sqldelight icon indicating copy to clipboard operation
sqldelight copied to clipboard

verifySqlDelightMigration hangs

Open vanniktech opened this issue 10 months ago • 9 comments

SQLDelight Version

2.0.0

Application Operating System

Android

Describe the Bug

When executing the verifySqlDelightMigration tasks it seems to run forever. Yesterday I had it actually running in the background it and was going for almost 5 hours. Just today I noticed this too:

Calculating task graph as no configuration cache is available for tasks: verifySqlDelightMigration
<-------------> 0% EXECUTING [5m 52s]
> :database:verifyCommonMainQueryWrapperMigration

My initial guess is that it's somehow a Gradle regression from a previous update that I did. I can also reliably reproduce this; what would be the best way to find out what is exactly is causing this?

I'm using Gradle 8.4

Stacktrace

No response

vanniktech avatar Oct 25 '23 21:10 vanniktech

I'm experiencing this issue as well, on versions 2.0.0-rc02 and 2.0.0, using Gradle 8.2.1.

With the --debug flag, Gradle output mostly consists of blocks like this, repeated many times but not always with the same table and rows. I'd send the entire log, but it's gigantic. I ran the task for under a minute, and it outputted over 3600 occurences of "Detected circular reference in node at path".

2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/tableConstraintOrdinalPosition ] Remembering --- WORKING: 1 <=> BASE: 1
2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/tableConstraintOrdinalPosition ] Forgetting --- WORKING: 1 <=> BASE: 1
2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type ] Remembering --- WORKING: TEXT <=> BASE: TEXT
2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/attributes ] Remembering --- WORKING: {SQL_DATA_TYPE=0, SQL_DATETIME_SUB=0} <=> BASE: {SQL_DATA_TYPE=0, SQL_DATETIME_SUB=0}
2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/attributes{SQL_DATA_TYPE} ] Remembering --- WORKING: 0 <=> BASE: 0
2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/attributes{SQL_DATA_TYPE} ] Forgetting --- WORKING: 0 <=> BASE: 0
2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/attributes{SQL_DATETIME_SUB} ] Remembering --- WORKING: 0 <=> BASE: 0
2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/attributes{SQL_DATETIME_SUB} ] Forgetting --- WORKING: 0 <=> BASE: 0
2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/attributes ] Forgetting --- WORKING: {SQL_DATA_TYPE=0, SQL_DATETIME_SUB=0} <=> BASE: {SQL_DATA_TYPE=0, SQL_DATETIME_SUB=0}
2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/autoIncrementable ] Remembering --- WORKING: false <=> BASE: false
2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/autoIncrementable ] Forgetting --- WORKING: false <=> BASE: false
2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/caseSensitive ] Remembering --- WORKING: true <=> BASE: true
2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/caseSensitive ] Forgetting --- WORKING: true <=> BASE: true
2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/databaseSpecificTypeName ] Remembering --- WORKING: TEXT <=> BASE: TEXT
2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/databaseSpecificTypeName ] Forgetting --- WORKING: TEXT <=> BASE: TEXT
2023-11-01T19:11:36.180+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/enumValues ] Remembering --- WORKING: [] <=> BASE: []
2023-11-01T19:11:36.181+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/enumValues ] Forgetting --- WORKING: [] <=> BASE: []
2023-11-01T19:11:36.181+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/enumerated ] Remembering --- WORKING: false <=> BASE: false
2023-11-01T19:11:36.181+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/enumerated ] Forgetting --- WORKING: false <=> BASE: false
2023-11-01T19:11:36.181+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/fixedPrecisionScale ] Remembering --- WORKING: false <=> BASE: false
2023-11-01T19:11:36.181+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/fixedPrecisionScale ] Forgetting --- WORKING: false <=> BASE: false
2023-11-01T19:11:36.181+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/javaSqlType ] Remembering --- WORKING: VARCHAR	12	character <=> BASE: VARCHAR	12	character
2023-11-01T19:11:36.181+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/javaSqlType/defaultMappedClass ] Remembering --- WORKING: class java.lang.String <=> BASE: class java.lang.String
2023-11-01T19:11:36.181+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/javaSqlType/defaultMappedClass ] Forgetting --- WORKING: class java.lang.String <=> BASE: class java.lang.String
2023-11-01T19:11:36.181+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/javaSqlType/javaSqlTypeGroup ] Remembering --- WORKING: character <=> BASE: character
2023-11-01T19:11:36.181+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/javaSqlType/javaSqlTypeGroup ] Forgetting --- WORKING: character <=> BASE: character
2023-11-01T19:11:36.181+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/javaSqlType/name ] Remembering --- WORKING: VARCHAR <=> BASE: VARCHAR
2023-11-01T19:11:36.182+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/javaSqlType/name ] Forgetting --- WORKING: VARCHAR <=> BASE: VARCHAR
2023-11-01T19:11:36.182+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/javaSqlType/vendor ] Remembering --- WORKING: java.sql <=> BASE: java.sql
2023-11-01T19:11:36.182+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/javaSqlType/vendor ] Forgetting --- WORKING: java.sql <=> BASE: java.sql
2023-11-01T19:11:36.182+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/javaSqlType/vendorTypeNumber ] Remembering --- WORKING: 12 <=> BASE: 12
2023-11-01T19:11:36.182+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/javaSqlType/vendorTypeNumber ] Forgetting --- WORKING: 12 <=> BASE: 12
2023-11-01T19:11:36.182+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/javaSqlType ] Forgetting --- WORKING: VARCHAR	12	character <=> BASE: VARCHAR	12	character
2023-11-01T19:11:36.182+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/maximumScale ] Remembering --- WORKING: 0 <=> BASE: 0
2023-11-01T19:11:36.182+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/maximumScale ] Forgetting --- WORKING: 0 <=> BASE: 0
2023-11-01T19:11:36.182+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/minimumScale ] Remembering --- WORKING: 0 <=> BASE: 0
2023-11-01T19:11:36.182+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/minimumScale ] Forgetting --- WORKING: 0 <=> BASE: 0
2023-11-01T19:11:36.182+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/name ] Remembering --- WORKING: TEXT <=> BASE: TEXT
2023-11-01T19:11:36.182+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/name ] Forgetting --- WORKING: TEXT <=> BASE: TEXT
2023-11-01T19:11:36.183+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/nullable ] Remembering --- WORKING: true <=> BASE: true
2023-11-01T19:11:36.183+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/nullable ] Forgetting --- WORKING: true <=> BASE: true
2023-11-01T19:11:36.183+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/numPrecisionRadix ] Remembering --- WORKING: 10 <=> BASE: 10
2023-11-01T19:11:36.183+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/numPrecisionRadix ] Forgetting --- WORKING: 10 <=> BASE: 10
2023-11-01T19:11:36.183+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/precision ] Remembering --- WORKING: 0 <=> BASE: 0
2023-11-01T19:11:36.183+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/precision ] Forgetting --- WORKING: 0 <=> BASE: 0
2023-11-01T19:11:36.183+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/remarks ] Remembering --- WORKING:  <=> BASE: 
2023-11-01T19:11:36.183+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/remarks ] Forgetting --- WORKING:  <=> BASE: 
2023-11-01T19:11:36.183+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/schema ] Remembering --- WORKING:  <=> BASE: 
2023-11-01T19:11:36.183+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/schema/attributes ] Remembering --- WORKING: {} <=> BASE: {}
2023-11-01T19:11:36.183+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/schema/attributes ] Forgetting --- WORKING: {} <=> BASE: {}
2023-11-01T19:11:36.184+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/schema/remarks ] Remembering --- WORKING:  <=> BASE: 
2023-11-01T19:11:36.184+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/schema/remarks ] Forgetting --- WORKING:  <=> BASE: 
2023-11-01T19:11:36.184+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/schema ] Forgetting --- WORKING:  <=> BASE: 
2023-11-01T19:11:36.184+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/searchable ] Remembering --- WORKING: searchable <=> BASE: searchable
2023-11-01T19:11:36.184+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/searchable ] Forgetting --- WORKING: searchable <=> BASE: searchable
2023-11-01T19:11:36.184+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/type ] Remembering --- WORKING: system <=> BASE: system
2023-11-01T19:11:36.184+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/type ] Forgetting --- WORKING: system <=> BASE: system
2023-11-01T19:11:36.184+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/typeMappedClass ] Remembering --- WORKING: class java.lang.String <=> BASE: class java.lang.String
2023-11-01T19:11:36.184+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/typeMappedClass ] Forgetting --- WORKING: class java.lang.String <=> BASE: class java.lang.String
2023-11-01T19:11:36.184+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/unsigned ] Remembering --- WORKING: true <=> BASE: true
2023-11-01T19:11:36.184+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type/unsigned ] Forgetting --- WORKING: true <=> BASE: true
2023-11-01T19:11:36.184+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/type ] Forgetting --- WORKING: TEXT <=> BASE: TEXT
2023-11-01T19:11:36.185+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/width ] Remembering --- WORKING:  <=> BASE: 
2023-11-01T19:11:36.185+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id]/width ] Forgetting --- WORKING:  <=> BASE: 
2023-11-01T19:11:36.185+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns[ArtistLayoutItem.item_id] ] Forgetting --- WORKING: ArtistLayoutItem.item_id <=> BASE: ArtistLayoutItem.item_id
2023-11-01T19:11:36.185+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/constrainedColumns ] Forgetting --- WORKING: [ArtistLayoutItem.item_id] <=> BASE: [ArtistLayoutItem.item_id]
2023-11-01T19:11:36.185+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/deferrability ] Remembering --- WORKING: initially deferred <=> BASE: initially deferred
2023-11-01T19:11:36.185+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/deferrability ] Forgetting --- WORKING: initially deferred <=> BASE: initially deferred
2023-11-01T19:11:36.185+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/definition ] Remembering --- WORKING:  <=> BASE: 
2023-11-01T19:11:36.185+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/definition ] Forgetting --- WORKING:  <=> BASE: 
2023-11-01T19:11:36.185+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/deleteRule ] Remembering --- WORKING: no action <=> BASE: no action
2023-11-01T19:11:36.185+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/deleteRule ] Forgetting --- WORKING: no action <=> BASE: no action
2023-11-01T19:11:36.185+0000 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/foreignKeyTable ] Remembering --- WORKING: ArtistLayoutItem <=> BASE: ArtistLayoutItem
2023-11-01T19:11:36.185+0000 [DEBUG] [app.cash.sqldelight.gradle.VerifyMigrationTask] Detected circular reference in node at path /tables[ArtistLayout]/foreignKeys[ArtistLayoutItem.SCHCRWLR_ED054971_ED941824]/foreignKeyTable/foreignKeys[ArtistLayoutItem.SCHCRWLR_F701ECF7_ED941824]/foreignKeyTable Going deeper would cause an infinite loop, so I'll stop looking at this instance along the current path.

My database schema is here. I've had no issues with using the database or migration, only with the verifySqlDelightMigration task.

My only migration file (1.sqm):

ALTER TABLE Playlist ADD COLUMN playlist_url TEXT;
ALTER TABLE SongFeedRow ADD COLUMN layout_type INTEGER;

toasterofbread avatar Nov 01 '23 19:11 toasterofbread

Running with info yields this:

-- generated by: SchemaCrawler 16.19.2
-- generated on: 2023-11-11T18:59:00.209768
-- database: SQLite 3.42.0
-- driver: SQLite JDBC 3.42.0.0
-- operating system: Mac OS X 14.1.1
-- JVM system: Homebrew OpenJDK 64-Bit Server VM 21.0.1

Retrieved 1 schemas
Retrieved 73 tables
Not retrieving routines, since this was not requested
Not retrieving synonyms, since this was not requested
Not retrieving sequences, since this was not requested
Total time taken for <fcc9b256-7b33-45a3-a3f0-32b46aa4ef7f> - 00:00:00.510 hours
-  0.0% - 00:00:00.000 - <retrieve_additional_database_info>
-  0.0% - 00:00:00.000 - <retrieve_server_info>
-  0.0% - 00:00:00.000 - <retrieve_database_users>
-  0.0% - 00:00:00.000 - <retrieve_additional_jdbc_driver_info>
-  0.0% - 00:00:00.000 - <retrieve_schemas>
-  0.0% - 00:00:00.000 - <filter_and_sort_schemas>
-  0.0% - 00:00:00.000 - <retrieve_column_data_types>
-  0.0% - 00:00:00.000 - <retrieve_user_defined_column_data_types>
-  0.2% - 00:00:00.001 - <retrieve_tables>
- 13.3% - 00:00:00.068 - <retrieve_table_columns>
- 17.3% - 00:00:00.088 - <retrieve_primary_keys>
- 52.5% - 00:00:00.268 - <retrieve_foreign_keys>
- 14.7% - 00:00:00.075 - <retrieve_indexes>
-  0.0% - 00:00:00.000 - <retrieve_table_constraints>
-  0.0% - 00:00:00.000 - <retrieve_trigger_information>
-  0.2% - 00:00:00.001 - <filter_and_sort_tables>
-  0.0% - 00:00:00.000 - <match_table_constraints>
-  0.0% - 00:00:00.000 - <retrieve_table_constraint_definitions>
-  0.0% - 00:00:00.000 - <retrieve_table_constraint_information>
-  0.0% - 00:00:00.000 - <retrieve_view_information>
-  0.0% - 00:00:00.000 - <retrieve_view_table_usage>
-  0.2% - 00:00:00.001 - <retrieve_table_definitions_information>
-  0.0% - 00:00:00.000 - <retrieve_index_information>
-  0.0% - 00:00:00.000 - <retrieve_additional_table_attributes>
-  0.0% - 00:00:00.000 - <retrieve_table_privileges>
-  0.0% - 00:00:00.000 - <retrieve_table_column_privileges>
-  0.0% - 00:00:00.000 - <retrieve_additional_column_attributes>
-  0.0% - 00:00:00.000 - <retrieve_additional_column_metadata>

and then it stops, my assumption is that maybe with the locally installed sqlite version there are some problems. I have it installed through homebrew.

vanniktech avatar Nov 11 '23 18:11 vanniktech

Happening to me too… Wondering if it's because of my usage of upsert available in newer Sqlite versions:

INSERT INTO x VALUES ? ON CONFLICT(client_id) DO UPDATE SET

But it's just a wild guess.

Even with a 1.db file and 1.sqm file placed in various directories under src/commonMain/sqldelight/ the IDE still doesn't seem to see that the migration exists, so I wonder if that's related:

Screenshot 2023-11-30 at 6 56 53 PM

darvelo avatar Nov 30 '23 11:11 darvelo

It suddenly started to hang for me too. I tried to revert my project to a very old commit that I'm sure was working fine, but it was hanging as well.

Then I remembered that I updated JDK on my computer from v20 to v21 recently. I then manually installed Java 20 (brew install --cask temurin20 + manually set JAVA_HOME) and suddenly verifySqlDelightMigration started to work fine again.

So I'm pretty sure there's something in Java 21 that makes it hang.

alexvasilkov avatar Feb 01 '24 21:02 alexvasilkov

mine isn't hanging but it's just taking much longer (2 minutes became 15), and thanks to @alexvasilkov I was able to confirm that Java 21 was the main culprit.

it was also somehow related to a migration - our 295th one - that alone caused verify to take more than twice as long. That migration simply re-created a table in order to make one of its columns a foreign key, so something like:

DROP TABLE MyTable;
CREATE TABLE MyTable(
  id TEXT NOT NULL,
  anotherId TEXT NOT NULL REFERENCES AnotherTable(id) ON DELETE CASCADE
)

in order to isolate the issue, I changed just 1 line in that migration, so it still re-created the table, but without making that column an FK, and that fixed the task duration spike:

DROP TABLE MyTable;
CREATE TABLE MyTable(
  id TEXT NOT NULL,
  anotherId TEXT NOT NULL
)

but Java 20 makes it even faster and allows me to keep my migration as intended, with the FK

gobetti avatar Feb 07 '24 22:02 gobetti

There might be two separate bugs here, in my case it happens with Java 17.

toasterofbread avatar Feb 08 '24 10:02 toasterofbread

Same issue, impossible to finish verification task in finite time (I tried 1h).

--debug prints repeating logs like:

2024-02-22T08:42:42.696+0100 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[inventoryStatus]/foreignKeys[inventory.fk_statusId]/foreignKeyTable/foreignKeys[inventory.fk_shopId]/primaryKeyTable/foreignKeys[expectedCount.fk_shopId]/foreignKeyTable/foreignKeys[expectedCount.fk_categoryId]/primaryKeyTable/foreignKeys[category.fk_mainCategoryId]/primaryKeyTable/foreignKeys[inventoryExtent.fk_mainCategoryId]/foreignKeyTable/foreignKeys[inventoryExtent.fk_productId]/primaryKeyTable/foreignKeys[deliveryNotePosition.fk_productId]/foreignKeyTable/foreignKeys[deliveryNotePosition.fk_deliveryNoteId]/primaryKeyTable/foreignKeys[deliveryNote.fk_partnerId_intermediate]/primaryKeyTable/foreignKeys[loanerNote.fk_partnerId_sender]/foreignKeyTable/columns[loanerNote.receiverText]/columnDataType/javaSqlType/javaSqlTypeGroup ] Remembering --- WORKING: character <=> BASE: null
2024-02-22T08:42:42.696+0100 [DEBUG] [de.danielbechler.diff.differ.DifferDispatcher] [ /tables[inventoryStatus]/foreignKeys[inventory.fk_statusId]/foreignKeyTable/foreignKeys[inventory.fk_shopId]/primaryKeyTable/foreignKeys[expectedCount.fk_shopId]/foreignKeyTable/foreignKeys[expectedCount.fk_categoryId]/primaryKeyTable/foreignKeys[category.fk_mainCategoryId]/primaryKeyTable/foreignKeys[inventoryExtent.fk_mainCategoryId]/foreignKeyTable/foreignKeys[inventoryExtent.fk_productId]/primaryKeyTable/foreignKeys[deliveryNotePosition.fk_productId]/foreignKeyTable/foreignKeys[deliveryNotePosition.fk_deliveryNoteId]/primaryKeyTable/foreignKeys[deliveryNote.fk_partnerId_intermediate]/primaryKeyTable/foreignKeys[loanerNote.fk_partnerId_sender]/foreignKeyTable/columns[loanerNote.receiverText]/columnDataType/javaSqlType/javaSqlTypeGroup ] Forgetting --- WORKING: character <=> BASE: null
java --version
openjdk 17.0.7 2023-04-18
OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
OpenJDK 64-Bit Server VM (build 17.0.7+0-17.0.7b1000.6-10550314, mixed mode)

sqldelight = "2.1.0-SNAPSHOT" Gradle 8.2

  • one db file 62.db
  • 61 migrations (1.sqm - 61.sqm)
  • 48 tables
  • 94 indexes
  • 34 views
  • 2 triggers

dees91 avatar Feb 22 '24 07:02 dees91

I've finally had some time to track down the root cause and I believe this task is able to finish after all it's just that every combined PRIMARY KEY using two columns exponentially slows this down.

Here is a public reproducer: https://github.com/vanniktech/playground/pull/201

If I execute the verify task ./gradlew verifySqlDelightMigration --info --rerun-tasks as is on the branch it takes on my computer ~33 seconds. This should never take this long. We're talking about 6 tables and a total of only 9 columns.

  1. If I delete FitnessProfileEquipment.sq
  2. Delete the database via find . -name "*.db" -exec rm {} \;
  3. Create a new database file to verify against ./gradlew generateCommonMainQueryWrapperSchema
  4. Rerun the task ./gradlew verifySqlDelightMigration --info --rerun-tasks

It only takes 1 second.

vanniktech avatar Apr 22 '24 14:04 vanniktech

I've finally had some time to track down the root cause and I believe this task is able to finish after all it's just that every combined PRIMARY KEY using two columns exponentially slows this down.

Here is a public reproducer: vanniktech/playground#201

If I execute the verify task ./gradlew verifySqlDelightMigration --info --rerun-tasks as is on the branch it takes on my computer ~33 seconds. This should never take this long. We're talking about 6 tables and a total of only 9 columns.

  1. If I delete FitnessProfileEquipment.sq
  2. Delete the database via find . -name "*.db" -exec rm {} \;
  3. Create a new database file to verify against ./gradlew generateCommonMainQueryWrapperSchema
  4. Rerun the task ./gradlew verifySqlDelightMigration --info --rerun-tasks

It only takes 1 second.

In my case, it turned out that foreign keys slowed down the verification dramatically (unable to complete within a few hours). I removed the foreign keys from my schema as a test and the verification passed within a few seconds...

I started digging deeper and after analyzing what VerifyMigrationTask was doing, I found that underneath it was using SchemaCrawler, which version of the dependency was bumped after a few years.

I think it is something in the changes of this library that changes in the behaviour of VerifyMigrationTask.

What I have managed to figure out so far is that the level of detail in database comparison is determined by the SchemaInfoLevel set to maximum in CatalogDatabase. I tested migration verification with foreign keys for which verification could not be completed earlier and with the minimum level, and the verification passed in a few seconds!

Maybe it would be possible to parameterize this setting so that you can decide at what level you want to run the verification? I'll try to prepare PR.

dees91 avatar Apr 25 '24 14:04 dees91

I've finally had some time to track down the root cause and I believe this task is able to finish after all it's just that every combined PRIMARY KEY using two columns exponentially slows this down. Here is a public reproducer: vanniktech/playground#201 If I execute the verify task ./gradlew verifySqlDelightMigration --info --rerun-tasks as is on the branch it takes on my computer ~33 seconds. This should never take this long. We're talking about 6 tables and a total of only 9 columns.

  1. If I delete FitnessProfileEquipment.sq
  2. Delete the database via find . -name "*.db" -exec rm {} \;
  3. Create a new database file to verify against ./gradlew generateCommonMainQueryWrapperSchema
  4. Rerun the task ./gradlew verifySqlDelightMigration --info --rerun-tasks

It only takes 1 second.

In my case, it turned out that foreign keys slowed down the verification dramatically (unable to complete within a few hours). I removed the foreign keys from my schema as a test and the verification passed within a few seconds...

I started digging deeper and after analyzing what VerifyMigrationTask was doing, I found that underneath it was using SchemaCrawler, which version of the dependency was bumped after a few years.

I think it is something in the changes of this library that changes in the behaviour of VerifyMigrationTask.

What I have managed to figure out so far is that the level of detail in database comparison is determined by the SchemaInfoLevel set to maximum in CatalogDatabase. I tested migration verification with foreign keys for which verification could not be completed earlier and with the minimum level, and the verification passed in a few seconds!

Maybe it would be possible to parameterize this setting so that you can decide at what level you want to run the verification? I'll try to prepare PR.

I'm facing the same issue with a table that has an FK to another table and that table also as a FK. In my case the error I got from the verifyDatabaseMigration was:

* What went wrong:
Execution failed for task ':farore:repositories:verifyCommonMainTestSecurev2Migration'.
> A failure occurred while executing app.cash.sqldelight.gradle.VerifyMigrationTask$VerifyMigrationAction
   > Java heap space: failed reallocation of scalar replaced objects

bmoliveira avatar Aug 21 '24 18:08 bmoliveira