Index: openacs-4/packages/imsld/sql/postgresql/imsld-status-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/Attic/imsld-status-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/imsld/sql/postgresql/imsld-status-create.sql 27 Sep 2005 16:12:15 -0000 1.2 +++ openacs-4/packages/imsld/sql/postgresql/imsld-status-create.sql 4 Oct 2005 13:45:40 -0000 1.3 @@ -7,26 +7,38 @@ -- @creation-date sept-2005 -- -create table imsld_status_learner ( +create table imsld_status_user ( + imsld_id integer + constraint imsld_stat_imsldid_fk + references imsld_imslds + not null, role_part_id integer constraint imsld_stat_rp_fk references imsld_role_parts - not null, + not null, + completed_id integer + constraint imsld_stat_aid_fk + references cr_revisions -- reference to an learning_activity OR support_activity OR a + not null, -- ctivity_structure OR environment user_id integer constraint imsld_stat_user_fk references users not null, + type varchar(20) + check (type in ('learning','support','structure')), finished_date timestamptz default current_timestamp not null ); -create index imsld_stat_rp_idx on imsld_status_learner(role_part_id); -create index imsld_stat_user_idx on imsld_status_learner(user_id); +create index imsld_stat_imsld_idx on imsld_status_user(imsld_id); +create index imsld_stat_rp_idx on imsld_status_user(role_part_id); +create index imsld_stat_comp_idx on imsld_status_user(completed_id); +create index imsld_stat_user_idx on imsld_status_user(user_id); -comment on table imsld_status_learner is ' -This table holds the status of each learner in the unit of learning. -Each entry in this table says that the learner referenced by user_id has already COMPLETED the role part referenced by role_part_id, so if we want to know what role part is the next one for any learner, we just have to see the las completed role part which is the one stored in this table.'; +comment on table imsld_status_user is ' +This table holds the status of each user in the unit of learning. +Each entry in this table says that the user referenced by user_id has already COMPLETED the role part referenced by role_part_id, so if we want to know what role part is the next one for any user, we have to see the las completed role part and find out which one is next.';