Reply To: going from version 2018.1.3 to 2019.1.1 (database issue)

#686
chris
Participant

Finally got something to work on……..no idea what to do with it though 😀 was a late night though and an early morning. Will maybe digest it better later in the day:

[21-Oct-2019 23:51:52 America/Los_Angeles]
Unable to apply patch 318. Found foreign key table columns with values not in
the reference table column. The following list shows what values in foreign
key columns are missing from reference columns.

There two ways to fix this situation. Either change the row columns to reference
an existing record in the REFERENCE TABLE, or delete the rows that contain
the invalid columns.

To do this, the following example of the SQL statements to execute for the test
case where the ‘cron_log’ table contains invalid values ‘2’ and ‘3’ in the
‘cron_id’ column. The SQL statements to consider using are:

UPDATE si_cron_log SET cron_id = 6 WHERE cron_id IN (2,3);
—- or —-
DELETE FROM si_cron_log WHERE cron_id IN (2,3);

FOREIGN KEY TABLE COLUMN REFERENCE TABLE COLUMN INVALID VALUE
———————— —————— ———————– ——— ————-
cron_log cron_id cron id 2
cron_log cron_id cron id 3
cron_log cron_id cron id 4
cron_log cron_id cron id 5
cron_log cron_id cron id 6
cron_log cron_id cron id 7
cron_log cron_id cron id 8
cron_log cron_id cron id 9
cron_log cron_id cron id 10
cron_log cron_id cron id 11
cron_log cron_id cron id 12
cron_log cron_id cron id 13
cron_log cron_id cron id 14
cron_log cron_id cron id 18
cron_log cron_id cron id 30
cron_log cron_id cron id 31
cron_log cron_id cron id 35
cron_log cron_id cron id 37
cron_log cron_id cron id 41
expense customer_id customers id 0
expense invoice_id invoices id 0

[21-Oct-2019 23:51:52 America/Los_Angeles] SqlPatchManager::runSqlPatch() – SqlPatchManager::prePatch318() = Unable to set Foreign Keys.
[21-Oct-2019 23:51:52 America/Los_Angeles] PdoDb destruct – incomplete transaction – rollback performed.