Skip to content

Commit

Permalink
->db->query(
Browse files Browse the repository at this point in the history
  • Loading branch information
stranac committed Jul 2, 2021
1 parent 55f4252 commit d96e9a8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions upload/admin/model/extension/payment/coingate.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ public function install() {
");

// Modify the currency table to allow 4-character currency code
$this->db->query("
ALTER TABLE `" . DB_PREFIX . "currency`
MODIFY `code` VARCHAR(4) COLLATE utf8_general_ci NOT NULL;
$query = $this->db->query("
SELECT character_maximum_length
FROM information_schema.columns
WHERE table_name = '" . DB_PREFIX . "currency' and column_name = 'code';
");
if ((int)$query->row['character_maximum_length'] < 4) {
$this->db->query("
ALTER TABLE `" . DB_PREFIX . "currency`
MODIFY `code` VARCHAR(4) COLLATE utf8_general_ci NOT NULL;
");
}

$this->load->model('setting/setting');

Expand Down

0 comments on commit d96e9a8

Please sign in to comment.