ithinkdone

This commit is contained in:
Sampanna Rimal
2024-07-16 18:43:54 +05:45
parent 7d973eeed5
commit a44570897c
6 changed files with 206 additions and 42 deletions

View File

@ -180,6 +180,28 @@ class Welcome extends CI_Controller
if ($query->num_rows() == 0) {
$this->db->query("ALTER TABLE tbl_purchases ADD COLUMN purchase_ref VARCHAR(50)");
}
$query = $this->db->query("SHOW COLUMNS FROM tbl_accounts LIKE 'account_image'");
// If the column doesn't exist, alter the table to add it
if ($query->num_rows() == 0) {
$this->db->query("ALTER TABLE tbl_accounts ADD COLUMN account_image text");
}
$query = $this->db->query("SHOW COLUMNS FROM tbl_accounts LIKE 'account_number'");
// If the column doesn't exist, alter the table to add it
if ($query->num_rows() == 0) {
$this->db->query("ALTER TABLE tbl_accounts ADD COLUMN account_number VARCHAR(50)");
}
$query = $this->db->query("SHOW COLUMNS FROM tbl_accounts LIKE 'account_branch'");
// If the column doesn't exist, alter the table to add it
if ($query->num_rows() == 0) {
$this->db->query("ALTER TABLE tbl_accounts ADD COLUMN account_branch VARCHAR(50)");
}
$query = $this->db->query("SHOW COLUMNS FROM tbl_branches LIKE 'vat'");
// If the column doesn't exist, alter the table to add it