Cloudlog/application/migrations/142_lotw_users_call_unique.php
Peter Goodhall 3d7c5b5c6e [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
2023-09-07 15:17:39 +01:00

16 行
507 B
PHP

<?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`;");
}
}