• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ion_auth V2 meta table?

Is the meta table still used in V2? I have a large amount of fields to add and dont want them to go in the users table.

As far as I can tell I have set up everything correctly but it is not storing the additional data in the meta table.

Forexample in my ion_auth config file I have the following:

| -------------------------------------------------------------------------
| Tables.
| -------------------------------------------------------------------------
| Database table names.
$config['tables']['users']           = 'users';
$config['tables']['groups']          = 'groups';
$config['tables']['users_groups']    = 'users_groups';
$config['tables']['login_attempts']  = 'login_attempts';

$config['tables']['meta'] = 'users_profiles';

| Users table column and Group table column you want to join WITH.
| Joins from users.id
| Joins from groups.id
$config['join']['users']  = 'user_id';
$config['join']['groups'] = 'group_id';
$config['join']['meta'] = 'user_id';

     * Columns in your meta table,
     * id not required.
$config['columns'] = array('gender','dateofbirth','ethnicity');

In my data base I have a table called users_profiles that contains the fields

and in my controller I have the following just to test:

function add_admin_user(){

    $sections = array(
    'config'  => TRUE,
    'queries' => TRUE

        $username = 'benedmunds';
        $password = '12345678';
        $email = '[email protected]';
        $additional_data = array(
                                'gender' => 'Male',
                                'dateofbirth' => '1978-04-21',
                                'ethnicity' => 'white'
        $group = array('1'); // Sets user to admin. No need for array('1', '2') as user is always set to member by default

        $this->ion_auth->register($username, $password, $email, $additional_data, $group);

Any ideas?

Looks like everything goes in the user tables with v2. It was just adding
extra queries without much benefit.

Hmm, a project I am working on has extra fields of up to 14 - I preferred the meta table option to keep these fields separate. I just found it easier when working with the database on the command line.

It would be nice to still have this feature although it looks like the v2 codebase has changed significantly to remove the meta table.


You can just add your own meta table, and use a standard query to access the fields..thats what Iv done.

@andy78 hmm, that is true! I just tried it out there and used the user_id as the foreign key, worked a treat.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.