Skip to content
Snippets Groups Projects
Commit 9dd2fedf authored by srosse's avatar srosse
Browse files

OO-220: add missing sql statements

parent 237f948b
No related branches found
No related tags found
No related merge requests found

-- user view
create view o_bs_identity_short_v as (
select
ident.id as id_id,
ident.name as id_name,
ident.lastlogin as id_lastlogin,
ident.status as id_status,
us.user_id as us_id,
p_firstname.propvalue as first_name,
p_lastname.propvalue as last_name,
p_email.propvalue as email
from o_bs_identity as ident
inner join o_user as us on (ident.fk_user_id = us.user_id)
left join o_userproperty as p_firstname on (us.user_id = p_firstname.fk_user_id and p_firstname.propName = 'firstName')
left join o_userproperty as p_lastname on (us.user_id = p_lastname.fk_user_id and p_lastname.propName = 'lastName')
left join o_userproperty as p_email on (us.user_id = p_email.fk_user_id and p_email.propName = 'email')
);
-- assessment tables
-- efficiency statments
create table o_as_eff_statement (
id int8 not null,
version int4 not null,
lastmodified timestamp,
creationdate timestamp,
passed boolean,
score float4,
total_nodes int4,
attempted_nodes int4,
passed_nodes int4,
course_title varchar(255),
course_short_title varchar(128),
course_repo_key int8,
statement_xml text,
fk_identity int8,
fk_resource_id int8,
unique(fk_identity, fk_resource_id),
primary key (id)
);
alter table o_as_eff_statement add constraint eff_statement_id_cstr foreign key (fk_identity) references o_bs_identity (id);
create index eff_statement_repo_key_idx on o_as_eff_statement (course_repo_key);
-- user to course informations (was property initial and recent launch dates)
create table o_as_user_course_infos (
id int8 not null,
version int4 not null,
creationdate timestamp,
lastmodified timestamp,
initiallaunchdate timestamp,
recentlaunchdate timestamp,
visit int4,
timespend int8,
fk_identity int8,
fk_resource_id int8,
unique(fk_identity, fk_resource_id),
primary key (id)
);
alter table o_as_user_course_infos add constraint user_course_infos_id_cstr foreign key (fk_identity) references o_bs_identity (id);
alter table o_as_user_course_infos add constraint user_course_infos_res_cstr foreign key (fk_resource_id) references o_olatresource (resource_id);
-- assessment results
-- help view
create or replace view o_gp_contextresource_2_group_v as (
select
cg_bg2resource.groupcontextresource_id as groupcontextresource_id,
cg_bgcontext.groupcontext_id as groupcontext_id,
cg_bgroup.group_id as group_id,
cg_bg2resource.oresource_id as oresource_id,
cg_bgcontext.grouptype as grouptype,
cg_bgcontext.defaultcontext as defaultcontext,
cg_bgroup.groupname as groupname,
cg_bgroup.fk_ownergroup as fk_ownergroup,
cg_bgroup.fk_partipiciantgroup as fk_partipiciantgroup,
cg_bgroup.fk_waitinggroup as fk_waitinggroup
from o_gp_bgcontextresource_rel as cg_bg2resource
inner join o_gp_bgcontext as cg_bgcontext on (cg_bg2resource.groupcontext_fk = cg_bgcontext.groupcontext_id)
inner join o_gp_business as cg_bgroup on (cg_bg2resource.groupcontext_fk = cg_bgroup.groupcontext_fk)
);
-- notifications for e-portfolio
create or replace view o_ep_notifications_struct_v as (
select
......@@ -34,7 +112,7 @@ create or replace view o_ep_notifications_art_v as (
inner join o_ep_artefact as artefact on (artefact_link.fk_artefact_id = artefact.artefact_id)
left join o_ep_struct_el as root_struct on (struct.fk_struct_root_id = root_struct.structure_id)
);
create or replace view o_ep_notifications_rating_v as (
select
urating.rating_id as rating_id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment