2023-08-02 06:34:12 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
|
|
|
|
/*
|
2023-08-02 07:06:34 +00:00
|
|
|
* This adds a field to user-table to hold/persist language-setting per user
|
2023-08-02 06:34:12 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
class Migration_add_user_language extends CI_Migration {
|
|
|
|
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
if (!$this->db->field_exists('language', 'users')) {
|
|
|
|
$fields = array(
|
|
|
|
'language varchar(32) default "english"',
|
|
|
|
);
|
|
|
|
|
|
|
|
$this->dbforge->add_column('users', $fields);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
if ($this->db->field_exists('language', 'users')) {
|
|
|
|
$this->dbforge->drop_column('users', 'language');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|