Edit Database

Hi everybody... I m new to elgg... I want to add a new filed in my elgg_users_entity table. If i add it manually then my site messed up.... Any one tell me how to add field in elgg database?

Thanks in advance...

  • Whats the purpose of editing the DB? Elgg's Data model is so flexible. Have a look at the http://docs.elgg.org and learn about the data structure.

    If you can explain your requirement, we may be able to suggest you the best solution. If you are planning to add some extra user details, have a look at the profilemanager plugin.

  • Mushtaq,

    Unlike some frameworks, Elgg manages the database structure itself and you should not alter any of the tables.

    You can use the API to add metadata, relationships and annotations to Elgg entities. As Team Webgalli points out, there are also some plugins that help you do some of this through a web interface.

  • @ Team Webgalli

    I want to display a number along with user name on my site everywhere. For example if a user craete a photo album then it display on wall like:

    "2  Mushtaq created a new photo album Testing."

    so i want to add an auto increament field for number. when user register an id assign to it. then take this id and display it with name. Any suggestion how to add this field in elgg_user_entity table?

  • I'm not sure I understand your requirement fully, but you should not change the database.  Whatever it is you are trying to do can be done within the Elgg data model.

    I want to display a number along with user name on my site everywhere. For example if a user craete a photo album then it display on wall like:

    "2  Mushtaq created a new photo album Testing."

    What is the purpose of this number?  Users already have unique numbers assigned to them - the guid.  You can access that simply as an attribute of the user object: $user->guid

  • Hi everyone... I m new to elgg... I want to add a new column in my elgg_users_entity table called "role" with enum values ('super_admin','sub_admin','support_member','site_member') to handle user permissions depending upon roles. If I alter the table will it creates any problem  in the future if I want to upgrade Elgg with some newer version... Any one tell me how can I handle it ...?

    Thanks in advance...

  • Yes, it will create problems. Do not edit the tables! Use metadata instead.