SimpleInvoices Group Forum › Forums › Fearless359 SimpleInvoices Discussion Group › moving from one PC to anther
Tagged: patch 330
- This topic has 6 replies, 2 voices, and was last updated 1 year, 7 months ago by RRowley.
-
AuthorPosts
-
May 21, 2023 at 9:28 am #1907johnanastasioParticipant
Installing on a new Win 11 PC
Install process gives me the sample/demo user.
When trying to use existing file from other computer, upgrade database routine hangs here:SQL patch 330, Add invoice_item_id as a key for the invoice_item_tax table. has not been applied to the database
SQL patch 331, Add foreign key for invoice_item_id to invoice_item_tax table. has not been applied to the database
SQL patch 332, Add payment_warehouse table to the database. has not been applied to the database
SQL patch 333, Add warehouse_amount field to payment table. has not been applied to the database
SQL patch 334, Add payment delete days option. has not been applied to the database
SQL patch 335, Add invoice display days option. has not been applied to the databaseError Screen Message:
( ! ) Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1832 Cannot change column ‘tax_id’: used in a foreign key constraint ‘si_invoice_item_tax_ibfk_1’ in C:\wamp64B\www\simpleinvoices\Inc\Claz\PdoDb.php on line 1294
( ! ) PDOException: SQLSTATE[HY000]: General error: 1832 Cannot change column ‘tax_id’: used in a foreign key constraint ‘si_invoice_item_tax_ibfk_1’ in C:\wamp64B\www\simpleinvoices\Inc\Claz\PdoDb.php on line 1294
Call Stack
# Time Memory Function Location
1 0.0008 372592 {main}( ) …\index.php:0
2 0.1280 806392 Inc\Claz\SqlPatchManager::runPatches( ) …\index.php:228
3 0.1608 812888 Inc\Claz\SqlPatchManager::runSqlPatch( $id = 330, $patch = [‘sql_patch_ref’ => 330, ‘name’ => ‘Add invoice_item_id as a key for the invoice_item_tax table.’, ‘patch’ => ‘ALTER TABLEsi_invoice_item_tax
MODIFYinvoice_item_id
INT(11) UNSIGNED NOT NULL, MODIFYtax_id
INT(11) UNSIGNED NOT NULL; ALTER TABLEsi_invoice_item_tax
ADD KEYinvoice_item_id
(invoice_item_id
);’, ‘date’ => ‘20220926’, ‘source’ => ‘fearless359’] ) …\SqlPatchManager.php:215
4 0.1639 813264 Inc\Claz\PdoDb->query( $sql = ‘ALTER TABLEsi_invoice_item_tax
MODIFYinvoice_item_id
INT(11) UNSIGNED NOT NULL, MODIFYtax_id
INT(11) UNSIGNED NOT NULL; ALTER TABLEsi_invoice_item_tax
ADD KEYinvoice_item_id
(invoice_item_id
);’, $valuePairs = ??? ) …\SqlPatchManager.php:145
5 0.1639 813744 execute( )What did I break?
May 25, 2023 at 6:52 am #1908RRowleyParticipantVia phpMyAdmin, select the si_invoice_item_tax table and export it. Then zip the exported sql file and attach the zipped file to a response to this message. Chances are that the changes in patch 330 have already been applied. I want to verify this before I advise you what to do next.
May 26, 2023 at 6:31 am #1909johnanastasioParticipantHere you go, thank you in advance!!
Attachments:
May 26, 2023 at 6:32 am #1911johnanastasioParticipantForgot to add, none of the items use/add on tax
May 27, 2023 at 8:44 am #1912RRowleyParticipantJust wanted to verify that the changes that the update terminated on were indeed already present in your database. They are. So with the database at the point where the error occurred, execute the following SQL command to add the entry for the patch to the si_sql_patchmanager table:
INSERT INTO si_sql_patchmanager
(sql_patch_ref
,sql_patch
,sql_release
,sql_statement
,source
) VALUES
(330, ‘Add invoice_item_id as a key for the invoice_item_tax table.’, ‘20220926’, ‘ALTER TABLEsi_invoice_item_tax
MODIFYinvoice_item_id
INT(11) UNSIGNED NOT NULL, MODIFYtax_id
INT(11) UNSIGNED NOT NULL; ALTER TABLEsi_invoice_item_tax
ADD KEYinvoice_item_id
(invoice_item_id
);’, ‘fearless359’);This entry will to SI that that patch 330 has been applied and you can access SI and it will pick up applying the patches following this. Let me know how this works.
- This reply was modified 1 year, 7 months ago by RRowley.
May 27, 2023 at 3:03 pm #1914johnanastasioParticipantAfter pasting the above into the Run SQL query/queries box on table simpleinvoices.si_sql_patchmanager:
There is a red “X” on the side of the query box, when you hover over it the message is “unexpected token (near ALTER)
I’m by no means even an amateur at this but I’m trying LOLHere’s what I got:
Error
SQL query: CopyINSERT INTO si_sql_patchmanager (sql_patch_ref, sql_patch, sql_release, sql_statement, source) VALUES
(330, ‘Add invoice_item_id as a key for the invoice_item_tax table.’, ‘20220926’, ‘ALTER TABLE si_invoice_item_tax MODIFY invoice_item_id INT(11) UNSIGNED NOT NULL, MODIFY tax_id INT(11) UNSIGNED NOT NULL;
MySQL said: Documentation#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘invoice_item_id as a key for the invoice_item_tax table.’, ‘20220926’, ‘’ at line 2
May 28, 2023 at 6:48 am #1915RRowleyParticipantThe sinqle quotes surrounding the strings in the values were converted to a different character. I’ll try again and see if it stores correctly.
INSERT INTO si_sql_patchmanager (sql_patch_ref, sql_patch, sql_release, sql_statement, source) VALUES (330, 'Add invoice_item_id as a key for the invoice_item_tax table.', '20220926', 'ALTER TABLE si_invoice_item_tax MODIFY invoice_item_id INT(11) UNSIGNED NOT NULL, MODIFY tax_id INT(11) UNSIGNED NOT NULL; ALTER TABLE si_invoice_item_tax ADD KEY invoice_item_id (invoice_item_id);', 'fearless359');
This appears to work. Give it a try.
- This reply was modified 1 year, 7 months ago by RRowley.
-
AuthorPosts
- You must be logged in to reply to this topic.
Recent Comments