SimpleInvoices Group Forum › Forums › Fearless359 SimpleInvoices Discussion Group › I need help with Smarty Error › Reply To: I need help with Smarty Error
In the error log you will find the following statement:
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 7
invoice_items invoice_id invoices id 0
invoice_items product_id products id 19
invoice_items product_id products id 20
invoice_items product_id products id 21
This is telling you that there are orphaned records in your database. The table names are shown without the leading ‘si_” prefix.
The first error says there is a cron_log table record that has a cron_id field with a value of 7 that has no corresponding record in the cron table’s ID field.
The next says there is an invoice_items table record with an invoice_id field with a value of 0 that has no corresponding record in the invoices table’s ID field.
The final three errors say there are records in the invoice_items table with product_id fields containing values of 19, 20 and 21 with no corresponding records in the products table with those ID values.
You need to manually correct these issues. The first two are truly orphaned records and should just be deleted. The final three need to be reviewed. If these products should be valid, you need to add them to the products table if they don’t exist. And then you need to change the product_id of these orphaned records to have the correct value for the corresponding records with the ID’s in the products table.
The fact that these errors exist in the database, is why this foreign key support is being added at that time. Once you correct these issues, your conversion should process to completion.
Recent Comments