Add contact_important DB field to database updater
This commit is contained in:
+18
-2
@@ -378,13 +378,29 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){
|
|||||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.2.2'");
|
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.2.2'");
|
||||||
}
|
}
|
||||||
|
|
||||||
//if(CURRENT_DATABASE_VERSION == '0.2.2'){
|
if(CURRENT_DATABASE_VERSION == '0.2.2'){
|
||||||
// Insert queries here required to update to DB version 0.2.3
|
// Insert queries here required to update to DB version 0.2.3
|
||||||
|
|
||||||
|
// Add contact_important field to those who don't have it (installed before March 2022)
|
||||||
|
try {
|
||||||
|
mysqli_query($mysqli, "ALTER TABLE `contacts` ADD `contact_important` tinyint(1) NOT NULL DEFAULT 0 AFTER contact_password_hash;");
|
||||||
|
} catch (Exception $e) {
|
||||||
|
// Field already exists - that's fine
|
||||||
|
}
|
||||||
|
|
||||||
// Then, update the database to the next sequential version
|
// Then, update the database to the next sequential version
|
||||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.2.2'");
|
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.2.3'");
|
||||||
|
}
|
||||||
|
|
||||||
|
//if(CURRENT_DATABASE_VERSION == '0.2.3'){
|
||||||
|
// Insert queries here required to update to DB version 0.2.4
|
||||||
|
|
||||||
|
// Then, update the database to the next sequential version
|
||||||
|
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.2.4'");
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
// Up-to-date
|
// Up-to-date
|
||||||
}
|
}
|
||||||
@@ -5,4 +5,4 @@
|
|||||||
* It is used in conjunction with database_updates.php
|
* It is used in conjunction with database_updates.php
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DEFINE("LATEST_DATABASE_VERSION", "0.2.2");
|
DEFINE("LATEST_DATABASE_VERSION", "0.2.3");
|
||||||
Reference in New Issue
Block a user