sqldelight icon indicating copy to clipboard operation
sqldelight copied to clipboard

VerifyMigration gives weird false positive after upgrading to 2.0

Open ursusursus opened this issue 4 months ago • 1 comments

SQLDelight Version

2.0.2

Operating System

MacOS

Gradle Version

8.6

Kotlin Version

1.9.23

Dialect

Sqlite

AGP Version

8.3.1

Describe the Bug

I'm in the process of migrating from 1.5 to 2.0.2, and I'm getting what I believe is a false positive

* What went wrong:
Execution failed for task ':foo:db:verifyDebugAppDatabaseMigration'.
> A failure occurred while executing app.cash.sqldelight.gradle.VerifyMigrationTask$VerifyMigrationAction
   > Error migrating from 1.db, fresh database looks different from migration database:
     /tables[subscriber]/definition - CHANGED
       BEFORE:
         CREATE TABLE subscriber (
             id TEXT PRIMARY KEY NOT NULL,
             msisdn TEXT NOT NULL,
             dfault INTEGER NOT NULL,
             selected INTEGER NOT NULL DEFAULT 0,
             loaded INTEGER NOT NULL DEFAULT 0,
             tariff TEXT,
             activationTimestamp INTEGER,
             extraOffersApprovalState TEXT,
             usageGeneratedTimestamp INTEGER,
             type TEXT,
             credit TEXT,
             invoiceProfile TEXT,
             billingCycleStartTimestamp INTEGER,
             daysTillEndOfBillingCycle INTEGER,
             changedTariffInCurrentBillingCycle INTEGER,
             actualPrice REAL,
             userId TEXT NOT NULL,
             digitalSettings TEXT,
             billingCycleEndTimestamp INTEGER,
             networkZone TEXT,
             ssoAccount TEXT,
             maxIncludedSubscriptions INTEGER
         )
       AFTER:
         CREATE TABLE "subscriber" (
                "id"    TEXT NOT NULL,
                "msisdn"        TEXT NOT NULL,
                "dfault"        INTEGER NOT NULL,
                "selected"      INTEGER NOT NULL DEFAULT 0,
                "loaded"        INTEGER NOT NULL DEFAULT 0,
                "tariff"        TEXT,
                "activationTimestamp"   INTEGER,
                "extraOffersApprovalState"      TEXT,
                "usageGeneratedTimestamp"       INTEGER,
                "type"  TEXT,
                "credit"        TEXT,
                "invoiceProfile"        TEXT,
                "billingCycleStartTimestamp"    INTEGER,
                "daysTillEndOfBillingCycle"     INTEGER,
                "changedTariffInCurrentBillingCycle"    INTEGER,
                "actualPrice"   REAL,
                "userId"        TEXT NOT NULL, digitalSettings TEXT, billingCycleEndTimestamp INTEGER, networkZone TEXT, ssoAccount TEXT, maxIncludedSubscriptions INTEGER,
                PRIMARY KEY("id")
         )

the quotes and the long line are suspecious (?). I removed the comments from the source .sq and still no luck.

ursusursus avatar Apr 24 '24 18:04 ursusursus

While plugin is true in that the quotes were there in the reference db (all along -- not sure how they got there, probably somebody tinkered with it in sqlite browser), it should be logically the same (sqldelight 1.5.x passes this).

ursusursus avatar Apr 25 '24 19:04 ursusursus