Cloudlog/application/migrations/099_add_wwff_to_bandxuser.php

27 wiersze
684 B
PHP
Czysty Zwykły widok Historia

2022-09-20 15:25:50 +00:00
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_add_wwff_to_bandxuser extends CI_Migration {
public function up()
{
if (!$this->db->field_exists('wwff', 'bandxuser')) {
$fields = array(
'wwff' => array(
'type' => 'INT',
'constraint' => 20,
'unsigned' => TRUE,
),
);
$this->dbforge->add_column('bandxuser', $fields);
$this->db->query("update bandxuser set wwff = 1");
}
}
public function down()
{
$this->dbforge->drop_column('bandxuser', 'wwff');
}
}