Skip to content

Commit

Permalink
Fixed issue: Cannot log in anymore after updating when using MSSQL se…
Browse files Browse the repository at this point in the history
…rver
  • Loading branch information
c-schmitz committed Feb 28, 2024
1 parent 52991e0 commit 8968857
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions application/helpers/update/updates/Update_619.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ class Update_619 extends DatabaseUpdateBase
public function up()
{
$this->db->createCommand()->addColumn('{{users}}', 'user_status', 'integer DEFAULT 1');
$this->db->createCommand("UPDATE {{users}} SET user_status=1")->execute();
}
}
3 changes: 3 additions & 0 deletions application/helpers/update/updates/Update_623.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ public function up()
$this->db->createCommand("ALTER TABLE {{users}} ALTER COLUMN user_status SET DEFAULT 1;")->execute();
}
}
if (in_array(Yii::app()->db->getDriverName(), array('mssql', 'sqlsrv', 'dblib'))) {
$this->db->createCommand("UPDATE {{users}} SET user_status=1")->execute();
}
}
}

0 comments on commit 8968857

Please sign in to comment.