[Migration] Make the callsign field in the table lotw_users unique
Make the callsign field in the table lotw_users unique to stop issue #2469 happening again
这个提交包含在:
父节点
fbd0ec7ff1
当前提交
3d7c5b5c6e
共有 2 个文件被更改,包括 17 次插入 和 1 次删除
|
|
@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
|||
|
|
||||
*/
|
||||
|
||||
$config['migration_version'] = 141;
|
||||
$config['migration_version'] = 142;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Migration_lotw_users_call_unique extends CI_Migration {
|
||||
|
||||
public function up() {
|
||||
// Update lotw_users and make the callsign column unique
|
||||
$this->db->query("ALTER TABLE lotw_users ADD UNIQUE `callsign_index` (`callsign`);");
|
||||
}
|
||||
|
||||
public function down(){
|
||||
// Update lotw_users and make the callsign column not unique
|
||||
$this->db->query("ALTER TABLE lotw_users DROP UNIQUE `callsign_index`;");
|
||||
}
|
||||
}
|
||||
正在加载…
在新工单中引用