Added Recurring Invoice Reference ID to Invoices and Product ID reference to Invoice Items

This commit is contained in:
johnnyq
2025-03-10 12:26:14 -04:00
parent 89e59b2448
commit 244a47efad
3 changed files with 20 additions and 12 deletions
+9 -3
View File
@@ -2429,10 +2429,16 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.8.8'");
}
// if (CURRENT_DATABASE_VERSION == '1.8.8') {
// // Insert queries here required to update to DB version 1.8.9
if (CURRENT_DATABASE_VERSION == '1.8.8') {
mysqli_query($mysqli, "ALTER TABLE `invoices` ADD `invoice_recurring_invoice_id` INT(11) NOT NULL DEFAULT 0 AFTER `invoice_category_id`");
mysqli_query($mysqli, "ALTER TABLE `invoice_items` ADD `item_product_id` INT(11) NOT NULL DEFAULT 0 AFTER `item_tax_id`");
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.8.9'");
}
// if (CURRENT_DATABASE_VERSION == '1.8.9') {
// // Insert queries here required to update to DB version 1.9.0
// // Then, update the database to the next sequential version
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.8.9'");
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.9.0'");
// }
} else {
+3 -1
View File
@@ -929,6 +929,7 @@ CREATE TABLE `invoice_items` (
`item_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
`item_archived_at` datetime DEFAULT NULL,
`item_tax_id` int(11) NOT NULL DEFAULT 0,
`item_product_id` int(11) NOT NULL DEFAULT 0,
`item_quote_id` int(11) NOT NULL DEFAULT 0,
`item_recurring_id` int(11) NOT NULL DEFAULT 0,
`item_invoice_id` int(11) NOT NULL DEFAULT 0,
@@ -960,6 +961,7 @@ CREATE TABLE `invoices` (
`invoice_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
`invoice_archived_at` datetime DEFAULT NULL,
`invoice_category_id` int(11) NOT NULL,
`invoice_recurring_invoice_id` int(11) NOT NULL DEFAULT 0,
`invoice_client_id` int(11) NOT NULL,
PRIMARY KEY (`invoice_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
@@ -2381,4 +2383,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2025-02-26 12:58:39
-- Dump completed on 2025-03-10 12:25:19
+1 -1
View File
@@ -5,4 +5,4 @@
* It is used in conjunction with database_updates.php
*/
DEFINE("LATEST_DATABASE_VERSION", "1.8.8");
DEFINE("LATEST_DATABASE_VERSION", "1.8.9");