Crowd 2.0 : Database Schema and Example SQL for Crowd
This page last changed on Jul 29, 2009 by smaddox.
This page contains information about the Crowd database tables and some example SQL queries. On this page:
Crowd Database SchemaPlease refer to the diagram of the Crowd database schema. Crowd Database Table Information
Example SQL Queries
Examples in this section: Finding Users that are Members of a Groupselect child_name from cwd_membership where parent_name = '<group-name>' and membership_type='GROUP_USER' and group_type='GROUP'; Where <group-name> is the name of the desired group, e.g. crowd-administrators. Finding Attributes for a Specific Directoryselect directory_name, attribute_name, attribute_value from cwd_directory, cwd_directory_attribute where cwd_directory.id=cwd_directory_attribute.directory_id and directory_name='<directory_name>'; Where <directory_name> is the name of the desired directory. Finding Attributes for a Specific Userselect user_name, attribute_name, attribute_value from cwd_user, cwd_user_attribute where cwd_user.id=cwd_user_attribute.user_id and user_name = '<username>'; Where <username> is the account name of the desired user. Finding Attributes for a Specific Applicationselect application_name, attribute_name, attribute_value from cwd_application, cwd_application_attribute where cwd_application.id=cwd_application_attribute.application_id and application_name = '<application_name>' Where <application_name> is the name of the desired application. Finding the Groups which have Administrative Access to Crowdselect group_name from cwd_app_dir_group_mapping where application_id = (select id from cwd_application where application_name='crowd') Other Useful SQL Commands
Examples in this section: Resetting a User's PasswordThe example below resets a user's password to "admin" (no quotes):
update cwd_user set credential='x61Ey612Kl2gpFL56FT9weDnpSo4AV8j8+qx2AuTHdRyY036xxzTTrw10Wq3+4qQyB+XURPWx1ONxp3Y3pB37A==' where user_name='<username>'; Where <username> is the account name of the desired user. RELATED TOPICS
|
![]() |
Document generated by Confluence on Jul 30, 2009 01:30 |