--
-- Defines the set of available abstract datatypes for acs_attributes, along with
-- an optional default mapping to a database type, size, and constraint to use if the
-- attribute is created with create_attribute's storage_type param set to "type_specific"
-- and the create_storage_p param is set to true. These defaults can be overwritten by
-- the caller.
--
-- The set of pre-defined datatypes is inspired by XForms
-- (http://www.w3.org/TR/xforms-datamodel/).
--
CREATE TABLE acs_datatypes (
datatype varchar(50) PRIMARY KEY NOT NULL,
--
-- The maximum number of values that any attribute with this datatype
-- can have. Of the predefined attribute types, only "boolean" specifies
-- a non-null max_n_values, because it doesn't make sense to have a
-- boolean attribute with more than one value. There is no
-- corresponding min_n_values column, because each attribute may be
-- optional, i.e., min_n_values would always be zero.
--
max_n_values integer DEFAULT 1,
--
-- The base database type corresponding to the abstract datatype. For example "varchar" or
-- "integer".
--
database_type text(-5),
--
-- Optional default column size specification to append to the base database type. For
-- example "1000" for the "string" abstract datatype, or "10,2" for "number".
--
column_size text(-5),
--
-- Optional check constraint expression to declare for the type_specific database column. In
-- Oracle, for instance, the abstract "boolean" type is declared "text", with a column
-- check expression to restrict the values to "f" and "t".
--
column_check_expr text(-5),
--
-- Function to call for this datatype when building a select view. If not null, it will
-- be called with an attribute name and is expected to return an expression on that
-- attribute. Example: date attributes will be transformed to calls to "to_char()".
--
column_output_function text(-5)
);
CREATE TRIGGER RI_ConstraintTrigger_a_340277 AFTER DELETE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_noaction_del (disabled)
CREATE TRIGGER RI_ConstraintTrigger_a_340278 AFTER UPDATE FOR EACH ROW EXECUTE PROCEDURE RI_FKey_cascade_upd (disabled)
-- Tables with foreign keys that refer to acs_datatypes:
--acs_attributes(acs_datatypes_max_n_ck)
--acs_attributes(acs_datatypes_pk)
-- Table size: 8,192 bytes
-- Table rows: 18
Tables: