diff --git a/database_updates.php b/database_updates.php index 0fa0667d..d0ccc405 100644 --- a/database_updates.php +++ b/database_updates.php @@ -1786,10 +1786,19 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.7'"); } - // if (CURRENT_DATABASE_VERSION == '1.1.7') { - // // Insert queries here required to update to DB version 1.1.8 + if (CURRENT_DATABASE_VERSION == '1.1.7') { + + mysqli_query($mysqli, "ALTER TABLE `projects` ADD `project_due` DATE DEFAULT NULL AFTER `project_description`"); + mysqli_query($mysqli, "ALTER TABLE `tasks` ADD `task_order` INT(11) NOT NULL DEFAULT 0 AFTER `task_status`"); + mysqli_query($mysqli, "ALTER TABLE `task_templates` ADD `task_template_order` INT(11) NOT NULL DEFAULT 0 AFTER `task_template_description`"); + + mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.8'"); + } + + // if (CURRENT_DATABASE_VERSION == '1.1.8') { + // // Insert queries here required to update to DB version 1.1.9 // // Then, update the database to the next sequential version - // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.8"); + // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.9"); // } } else { diff --git a/database_version.php b/database_version.php index 44c7d40d..8aa90f59 100644 --- a/database_version.php +++ b/database_version.php @@ -5,4 +5,4 @@ * It is used in conjunction with database_updates.php */ -DEFINE("LATEST_DATABASE_VERSION", "1.1.7"); +DEFINE("LATEST_DATABASE_VERSION", "1.1.8"); diff --git a/db.sql b/db.sql index d69c94d0..aae0ddbb 100644 --- a/db.sql +++ b/db.sql @@ -960,6 +960,7 @@ CREATE TABLE `projects` ( `project_id` int(11) NOT NULL AUTO_INCREMENT, `project_name` varchar(255) NOT NULL, `project_description` text DEFAULT NULL, + `project_due` date DEFAULT NULL, `project_created_at` datetime NOT NULL DEFAULT current_timestamp(), `project_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(), `project_completed_at` datetime DEFAULT NULL, @@ -1511,6 +1512,7 @@ CREATE TABLE `task_templates` ( `task_template_id` int(11) NOT NULL AUTO_INCREMENT, `task_template_name` varchar(200) NOT NULL, `task_template_description` text DEFAULT NULL, + `task_template_order` int(11) NOT NULL DEFAULT 0, `task_template_created_at` datetime NOT NULL DEFAULT current_timestamp(), `task_template_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(), `task_template_archived_at` datetime DEFAULT NULL, @@ -1531,6 +1533,7 @@ CREATE TABLE `tasks` ( `task_name` varchar(255) NOT NULL, `task_description` text DEFAULT NULL, `task_status` varchar(255) DEFAULT NULL, + `task_order` int(11) NOT NULL DEFAULT 0, `task_completed_at` datetime DEFAULT NULL, `task_completed_by` int(11) DEFAULT NULL, `task_created_at` datetime NOT NULL DEFAULT current_timestamp(), @@ -1878,4 +1881,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2024-03-30 15:05:47 +-- Dump completed on 2024-03-31 13:55:08