--
-- f_classdefinition  -
--
DROP TABLE IF EXISTS f_classdefinition;

create table f_classdefinition (
    classid          serial not null,
    classname        varchar(255) not null,
    schemaname       varchar(255),
    tablename        varchar(64) not null,
    roottablename    varchar(64),
    tableowner       varchar(64),
    tablelinkname    varchar(128),
    tablemapping     varchar(64),
    classtype        smallint not null,
    description      varchar(255),
    isabstract       smallint not null,
    parentclassname  varchar(512),
    isfixedtable     smallint,
    istablecreator   smallint,
    hasversion       smallint,
    haslock          smallint,
    geometryproperty varchar(4000),

    CONSTRAINT f_classdefinition_pk PRIMARY KEY (classid)
);
COMMENT ON TABLE f_classdefinition IS 'Definition of classes from FDO feature schema.';

-- insert only classes that do not require any data in the F_AttributeDefinition table

insert into f_classdefinition
(classname, schemaname, tablename,classtype, description, isabstract, parentclassname, istablecreator, isfixedtable, hasversion, haslock)
values
('Class', 'F_MetaClass', ' ', 1, 'Non-feature metaclass', 0, 'ClassDefinition', 0, 1, 0, 0);