Search code examples
mysqldatabasecodeigniteruser-profiletankauth

What is the difference between users and user_profiles tables in Tank auth (CodeIgniter library)?


I have been going through Tank auth library all day with some success but I could not understand user_profiles table that is created in database.

CREATE TABLE IF NOT EXISTS `user_profiles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `country` varchar(20) COLLATE utf8_bin DEFAULT NULL,
  `website` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

I tried to google it but there wasn`t huge success ... There are articles about user accounts vs user profiles but there is no information about how it works in database level.

I have managed to adjust library for my needs - user now on registration are required to enter home address and it is saved in database in user table. But now I am doubting myself whether or not to save it under user_profiles for later use.

So the question - what is the reason for user_profiles table and how should I use it?


Solution

  • Use the users table to store the User object information i.e user_id, password etc...

    Use the users_profiles table to store information about the User object i.e address information