Skip to content
This repository has been archived by the owner on Jul 10, 2018. It is now read-only.

Commit

Permalink
fixes db error
Browse files Browse the repository at this point in the history
Duplicate entry 'smtp_crypto' for key 'PRIMARY'

Fixes error found by Softaculous devs.  This is where migrations fail
in a new install.
  • Loading branch information
enlivenapp committed Jan 10, 2018
1 parent 32b66e6 commit 5488ccd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions application/migrations/20171107000003_smtp_crypto.php
Expand Up @@ -7,15 +7,18 @@ class Migration_smtp_crypto extends CI_Migration {
public function up()
{

$insert_smtp_crypto = array(
if ( ! $this->db->field_exists('smtp_crypto', 'settings'))
{
$insert_smtp_crypto = array(
'name' => 'smtp_crypto',
'value' => 'tls',
'tab' => 'email',
'field_type' => 'dropdown',
'options' => 'tls=TLS|ssl=SSL',
'required' => '0'
);
$this->db->insert('settings', $insert_smtp_crypto);
$this->db->insert('settings', $insert_smtp_crypto);
}

$this->db->where('name', 'category_list_limit')->update('settings', array('tab' => 'limits'));
$this->db->where('name', 'links_per_box')->update('settings', array('tab' => 'limits'));
Expand Down

0 comments on commit 5488ccd

Please sign in to comment.