emmar
committed
on 09 Feb 10
HTML strict cleanup
/postgresql/curriculum-curriculum-create.sql (+58)
  1 -- packages/curriculum/sql/postgresql/curriculum-curriculum-create.sql
  2 --
  3 -- @author Ola Hansson (ola@polyxena.net)
  4 -- @creation-date 2003-05-23
  5 -- @cvs-id $Id$
  6
  7
  8 create table cu_curriculums (
  9     curriculum_id               integer
  10                             constraint cu_curriculums_curriculum_id_fk
  11                             references acs_objects (object_id)
  12                                         on delete cascade
  13                             constraint cu_curriculums_curriculum_id_pk
  14                             primary key,
  15     name                    varchar(200)
  16                             constraint cu_curriculums_name_nn
  17                             not null,
  18     description             text,
  19     desc_format             varchar(200),
  20     owner_id                integer
  21                             constraint cu_curriculums_owner_id_nn
  22                             not null
  23                                       -- owner can be any party, e.g., a group
  24                                         constraint cu_curriculums_owner_id_fk
  25                                         references parties (party_id),
  26     package_id              integer
  27                             constraint cu_curriculums_package_id_nn
  28                             not null
  29                                         constraint cu_curriculums_package_id_fk
  30                                         references apm_packages (package_id)
  31                                         on delete cascade,
  32     sort_key                integer
  33                             constraint cu_curriculums_sort_key_nn
  34                             not null
  35 );
  36
  37 comment on table cu_curriculums is '
  38 A package instance of Curriculum may contain any number of curriculums. However, only one package instance may be mounted per subsite (This limitation is less of a problem in dotLRN where every class, club, department, etc., is a subsite).
  39 ';
  40
  41 comment on column cu_curriculums.desc_format is '
  42 Stores the format of the contents in the description column. The possible formats are defined in the richtext datatype in the form builder and may grow in number over time or change, which is why we do not bother to add a check constraint ...
  43 ';
  44
  45 create index cu_curriculums_package_id_idx on cu_curriculums(package_id);
  46
  47 select acs_object_type__create_type (
  48     'cu_curriculum',             -- object_type
  49     'Curriculum',                -- pretty_name
  50     'Curriculums',               -- pretty_plural
  51     'acs_object',                -- supertype
  52     'cu_curriculums',            -- table_name
  53     'curriculum_id',             -- id_column
  54     'cu_curriculum',             -- package_name
  55     'f',                         -- abstract_p
  56     null,                        -- type_extension_table
  57     'cu_curriculum__name'        -- name_method
  58 );