[Migration] Added duplicate check on columns in script 082
这个提交包含在:
父节点
7debe5f33f
当前提交
73cf21c691
共有 1 个文件被更改,包括 12 次插入 和 5 次删除
|
|
@ -13,13 +13,20 @@ class Migration_add_reset_pass_to_users extends CI_Migration {
|
|||
|
||||
public function up()
|
||||
{
|
||||
if (!$this->db->field_exists('reset_password_code', 'users')) {
|
||||
$fields = array(
|
||||
'reset_password_code varchar(50) DEFAULT NULL',
|
||||
);
|
||||
$this->dbforge->add_column('users', $fields);
|
||||
}
|
||||
|
||||
if (!$this->db->field_exists('reset_password_date', 'users')) {
|
||||
$fields = array(
|
||||
'reset_password_date TIMESTAMP NULL DEFAULT NULL',
|
||||
);
|
||||
|
||||
$this->dbforge->add_column('users', $fields);
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
|
|
|
|||
正在加载…
在新工单中引用