Index: openacs-4/contrib/packages/simulation/sql/postgresql/simulation-content-types-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/sql/postgresql/Attic/simulation-content-types-create.sql,v diff -u -r1.16 -r1.17 --- openacs-4/contrib/packages/simulation/sql/postgresql/simulation-content-types-create.sql 18 Dec 2003 16:12:17 -0000 1.16 +++ openacs-4/contrib/packages/simulation/sql/postgresql/simulation-content-types-create.sql 19 Dec 2003 09:24:27 -0000 1.17 @@ -314,39 +314,3 @@ 10 -- max_n ); ----------------------------------------------------------------------- --- sim_case ----------------------------------------------------------------------- --- # TODO: foreign constraint for workflow_id - -select content_type__create_type( - 'sim_case', -- content_type - 'content_revision', -- supertype - 'Sim Case', -- pretty_name, - 'Sim Cases', -- pretty_plural - 'sim_cases', -- table_name - 'case_id', -- id_column - null -- name_method -); - -select content_type__create_attribute( - 'sim_case', -- content_type - 'workflow_id', -- attribute_name - 'integer', -- datatype - 'Workflow', -- pretty_name - 'Workflows', -- pretty_plural - 1, -- sort_order - null, -- default_value - 'integer' -- column_spec -); - -select content_type__create_attribute( - 'sim_case', -- content_type - 'sort_order', -- attribute_name - 'integer', -- datatype - 'Sort order', -- pretty_name - 'Sort orders', -- pretty_plural - 2, -- sort_order - null, -- default_value - 'integer' -- column_spec -); 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.17 -r1.18 --- openacs-4/contrib/packages/simulation/sql/postgresql/simulation-tables-create.sql 18 Dec 2003 17:21:06 -0000 1.17 +++ openacs-4/contrib/packages/simulation/sql/postgresql/simulation-tables-create.sql 19 Dec 2003 09:24:27 -0000 1.18 @@ -147,3 +147,35 @@ ); comment on table sim_case_role_object_map is 'The portfolio of sim_props for a role in a case.'; + + +---------------------------------------------------------------------- +-- sim_case +---------------------------------------------------------------------- + +select acs_object_type__create_type ( + 'sim_case', -- object_type + 'Simulation Case', -- pretty_name + 'Simulation Cases', -- pretty_plural + 'acs_object', -- supertype + 'sim_cases', -- table_name + 'sim_case_id' , -- id_column + null, -- package_name + 'f', -- abstract_p + null, -- type_extension_table + 'acs_object__name' -- name_method +); + +create table sim_cases ( + sim_case_id integer constraint sim_case_fk + references acs_objects + constraint sim_case_pk + primary key, + workflow_id integer constraint sim_case_workflow_fk + references workflows, + sort_order integer, + constraint sim_case_workflow_sort_order_un unique (workflow_id, sort_order) +); + +comment on table sim_cases is 'The object behind a simulation case.'; + Index: openacs-4/packages/simulation/sql/postgresql/simulation-content-types-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/sql/postgresql/simulation-content-types-create.sql,v diff -u -r1.16 -r1.17 --- openacs-4/packages/simulation/sql/postgresql/simulation-content-types-create.sql 18 Dec 2003 16:12:17 -0000 1.16 +++ openacs-4/packages/simulation/sql/postgresql/simulation-content-types-create.sql 19 Dec 2003 09:24:27 -0000 1.17 @@ -314,39 +314,3 @@ 10 -- max_n ); ----------------------------------------------------------------------- --- sim_case ----------------------------------------------------------------------- --- # TODO: foreign constraint for workflow_id - -select content_type__create_type( - 'sim_case', -- content_type - 'content_revision', -- supertype - 'Sim Case', -- pretty_name, - 'Sim Cases', -- pretty_plural - 'sim_cases', -- table_name - 'case_id', -- id_column - null -- name_method -); - -select content_type__create_attribute( - 'sim_case', -- content_type - 'workflow_id', -- attribute_name - 'integer', -- datatype - 'Workflow', -- pretty_name - 'Workflows', -- pretty_plural - 1, -- sort_order - null, -- default_value - 'integer' -- column_spec -); - -select content_type__create_attribute( - 'sim_case', -- content_type - 'sort_order', -- attribute_name - 'integer', -- datatype - 'Sort order', -- pretty_name - 'Sort orders', -- pretty_plural - 2, -- sort_order - null, -- default_value - 'integer' -- column_spec -); 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.17 -r1.18 --- openacs-4/packages/simulation/sql/postgresql/simulation-tables-create.sql 18 Dec 2003 17:21:06 -0000 1.17 +++ openacs-4/packages/simulation/sql/postgresql/simulation-tables-create.sql 19 Dec 2003 09:24:27 -0000 1.18 @@ -147,3 +147,35 @@ ); comment on table sim_case_role_object_map is 'The portfolio of sim_props for a role in a case.'; + + +---------------------------------------------------------------------- +-- sim_case +---------------------------------------------------------------------- + +select acs_object_type__create_type ( + 'sim_case', -- object_type + 'Simulation Case', -- pretty_name + 'Simulation Cases', -- pretty_plural + 'acs_object', -- supertype + 'sim_cases', -- table_name + 'sim_case_id' , -- id_column + null, -- package_name + 'f', -- abstract_p + null, -- type_extension_table + 'acs_object__name' -- name_method +); + +create table sim_cases ( + sim_case_id integer constraint sim_case_fk + references acs_objects + constraint sim_case_pk + primary key, + workflow_id integer constraint sim_case_workflow_fk + references workflows, + sort_order integer, + constraint sim_case_workflow_sort_order_un unique (workflow_id, sort_order) +); + +comment on table sim_cases is 'The object behind a simulation case.'; +