select segment_id
from rel_segments
where segment_name = 'dotLRN Users'
select theme_id
from dotlrn_users
where user_id = :user_id
update dotlrn_user_profile_rels
set theme_id = :theme_id
where rel_id = (select rel_id
from dotlrn_users
where user_id = :user_id)
select portal_id
from dotlrn_users
where user_id = :user_id
select dotlrn_user_types.group_id
from dotlrn_user_types
where dotlrn_user_types.type = :type
insert into dotlrn_portal_types_map
(type, portal_id)
values
(:type, :portal_id)
select type from dotlrn_portal_types_map where portal_id = :portal_id
select portal_id from dotlrn_portal_types_map where type = :type
select portal_theme_id
from dotlrn_site_templates
where site_template_id = :site_template_id
select portal_theme_id
from dotlrn_site_templates
where site_template_id = :site_template_id
update portals
set theme_id = :new_theme_id
where portal_id in ( select portal_id from dotlrn_users )
select
user_id
from dotlrn_users
update portals
set theme_id = :new_theme_id
where portal_id = :portal_id
update dotlrn_user_profile_rels
set site_template_id = :site_template_id
where rel_id = (select rel_id
from dotlrn_users
where user_id = :user_id)
select site_template_id
from dotlrn_users
where user_id = :user_id
select site_master
from dotlrn_site_templates
where site_template_id = :site_template_id