Index: openacs-4/contrib/packages/simulation/sql/postgresql/simulation-tables-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/sql/postgresql/Attic/simulation-tables-create.sql,v diff -u -r1.9 -r1.10 --- openacs-4/contrib/packages/simulation/sql/postgresql/simulation-tables-create.sql 28 Nov 2003 10:03:30 -0000 1.9 +++ openacs-4/contrib/packages/simulation/sql/postgresql/simulation-tables-create.sql 9 Dec 2003 17:23:09 -0000 1.10 @@ -9,11 +9,12 @@ constraint sim_simulation_pk primary key, suggested_duration interval, - ready_p boolean, + sim_type varchar(20) constraint sim_simulations_type_ck + check (sim_type in ('dev_template','ready_template','dev_sim','casting_sim','live_sim')), enroll_type varchar(20) constraint sim_simulations_enroll_type_ck - check (1=1), + check (enroll_type in ('invite','open')), casting_type varchar(20) constraint sim_simulations_casting_type_ck - check (1=1), + check (casting_type in ('auto','group','open')), enroll_start timestamptz, enroll_end timestamptz, constraint sim_simulations_enroll_end_after_start_end_ck @@ -66,6 +67,21 @@ comment on table sim_tasks is 'A 1-1 extension of workflow_actions. Each record is a task that a role must perform, possibly upon another role.'; +create table sim_task_object_map ( + task_id integer constraint stom_fk + references workflow_actions + on delete cascade, + object_id integer constraint stom_object_fk + references acs_objects + on delete cascade, + order_n integer, + relation_tag varchar(100), + constraint stom_pk + primary key (task_id, object_id, relation_tag) +); + +comment on table sim_task_object_map is 'A mapping table to show which tasks use which props. Each record is one prop for one task.'; + create table sim_party_sim_map ( simulation_id integer constraint sim_party_sim_map_sim_fk references sim_simulations @@ -78,3 +94,21 @@ ); comment on table sim_party_sim_map is 'Each record is an invitation to a party to participate in a simulation.'; + +create table sim_case_task_object_map ( + task_id integer constraint sctom_fk + references workflow_actions + on delete cascade, + object_id integer constraint sctom_object_fk + references acs_objects + on delete cascade, + case_id integer constraint sctom_case_fk + references workflow_cases + on delete cascade, + order_n integer, + relation_tag varchar(100), + constraint sctom_pk + primary key (task_id, object_id, case_id, relation_tag) +); + +comment on table sim_case_task_object_map is 'A mapping table to show which tasks use which props in a case. Each record is one prop for one task, in a case.'; Index: openacs-4/packages/simulation/sql/postgresql/simulation-tables-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/sql/postgresql/simulation-tables-create.sql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/simulation/sql/postgresql/simulation-tables-create.sql 28 Nov 2003 10:03:30 -0000 1.9 +++ openacs-4/packages/simulation/sql/postgresql/simulation-tables-create.sql 9 Dec 2003 17:23:09 -0000 1.10 @@ -9,11 +9,12 @@ constraint sim_simulation_pk primary key, suggested_duration interval, - ready_p boolean, + sim_type varchar(20) constraint sim_simulations_type_ck + check (sim_type in ('dev_template','ready_template','dev_sim','casting_sim','live_sim')), enroll_type varchar(20) constraint sim_simulations_enroll_type_ck - check (1=1), + check (enroll_type in ('invite','open')), casting_type varchar(20) constraint sim_simulations_casting_type_ck - check (1=1), + check (casting_type in ('auto','group','open')), enroll_start timestamptz, enroll_end timestamptz, constraint sim_simulations_enroll_end_after_start_end_ck @@ -66,6 +67,21 @@ comment on table sim_tasks is 'A 1-1 extension of workflow_actions. Each record is a task that a role must perform, possibly upon another role.'; +create table sim_task_object_map ( + task_id integer constraint stom_fk + references workflow_actions + on delete cascade, + object_id integer constraint stom_object_fk + references acs_objects + on delete cascade, + order_n integer, + relation_tag varchar(100), + constraint stom_pk + primary key (task_id, object_id, relation_tag) +); + +comment on table sim_task_object_map is 'A mapping table to show which tasks use which props. Each record is one prop for one task.'; + create table sim_party_sim_map ( simulation_id integer constraint sim_party_sim_map_sim_fk references sim_simulations @@ -78,3 +94,21 @@ ); comment on table sim_party_sim_map is 'Each record is an invitation to a party to participate in a simulation.'; + +create table sim_case_task_object_map ( + task_id integer constraint sctom_fk + references workflow_actions + on delete cascade, + object_id integer constraint sctom_object_fk + references acs_objects + on delete cascade, + case_id integer constraint sctom_case_fk + references workflow_cases + on delete cascade, + order_n integer, + relation_tag varchar(100), + constraint sctom_pk + primary key (task_id, object_id, case_id, relation_tag) +); + +comment on table sim_case_task_object_map is 'A mapping table to show which tasks use which props in a case. Each record is one prop for one task, in a case.';