I am attempting to manipulate the code so that each account has an associated Type. To do so, I need to update the database. I currently have this:
if (CURRENT_DATABASE_VERSION == '0.8.6') {
// Insert queries here required to update to DB version 0.8.7
mysqli_query($mysqli, "ALTER TABLE `accounts` ADD `account_type`
int
(6)
DEFAULT
NULL AFTER `account_notes`");
// Then, update the database to the next sequential version
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.8.7'"); }
and
DROP TABLE IF EXISTS `accounts`;
/*!40101 SET @saved_cs_client = @@character_set_client */
;
/*!40101 SET character_set_client = utf8 */
;
CREATE TABLE `accounts` (
`account_id`
int
(11) NOT NULL AUTO_INCREMENT,
`account_name`
varchar
(200) NOT NULL,
`opening_balance`
decimal
(15,2) NOT NULL
DEFAULT
0.00,
`account_currency_code`
varchar
(200) NOT NULL,
`account_notes`
text
DEFAULT
NULL,
`account_type`
int
(6) NOT NULL,
Changes here
`account_created_at` datetime NOT NULL
DEFAULT
current_timestamp(),
`account_updated_at` datetime
DEFAULT
NULL ON UPDATE current_timestamp(),
`account_archived_at` datetime
DEFAULT
NULL,
PRIMARY KEY
(`account_id`)
) ENGINE=InnoDB
DEFAULT
CHARSET=utf8mb4
COLLATE
=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */
;
I go to /post.php?update_db and get a confirmation that the database was updated, but i do not see it.