Hide Forgot
project_key: SOA modeshape/tools/PostgreSQL/create.modeshape-jpa-connector.ddl contains following DDL commands to create database for JPA connector create table DNA_NAMESPACES (id int8 not null, URI varchar(512), primary key (id)) create table DNA_WORKSPACES (id int8 not null, NAME varchar(128) not null, primary key (id)) create table MODE_OPTIONS (NAME varchar(128) not null, VALUE varchar(512) not null, primary key (NAME)) create table MODE_SIMPLE_LARGE_VALUES (SHA1 varchar(40) not null, COMPRESSED bool, DATA oid not null, LENGTH int8 not null, TYPE varchar(255) not null, primary key (SHA1)) create table MODE_SIMPLE_NODE (ID int8 not null, ALLOWS_SNS bool not null, CHILD_NAME_LOCAL varchar(512), COMPRESSED bool, DATA oid, CHILD_INDEX int4 not null, NODE_UUID varchar(36) not null, NUM_PROPS int4 not null, ENFORCEREFINTEG bool not null, SNS_INDEX int4 not null, WORKSPACE_ID int8 not null, CHILD_NAME_NS_ID int8, PARENT_ID int8, primary key (ID)) create table MODE_SUBGRAPH_NODES (ID int8 not null, DEPTH int4 not null, CHILD_NUM int4 not null, UUID varchar(36) not null, PARENT_NUM int4 not null, QUERY_ID int8 not null, primary key (ID)) create table MODE_SUBGRAPH_QUERIES (ID int8 not null, ROOT_UUID varchar(36) not null, WORKSPACE_ID int8 not null, primary key (ID)) create table ModeShape_LARGEVALUE_USAGES (ID int8 not null, largeValues_SHA1 varchar(40) not null) create index NS_URI_INX on DNA_NAMESPACES (URI) create index WS_NAME_INX on DNA_WORKSPACES (NAME) create index CHILDINDEX_INX on MODE_SIMPLE_NODE (WORKSPACE_ID, PARENT_ID, CHILD_INDEX) create index CHILDNAME_INX on MODE_SIMPLE_NODE (WORKSPACE_ID, PARENT_ID, CHILD_NAME_NS_ID, CHILD_NAME_LOCAL, SNS_INDEX) create index NODEUUID_INX on MODE_SIMPLE_NODE (WORKSPACE_ID, NODE_UUID) alter table MODE_SIMPLE_NODE add constraint FKE43E2BD346EF783F foreign key (CHILD_NAME_NS_ID) references DNA_NAMESPACES alter table MODE_SIMPLE_NODE add constraint FKE43E2BD360F39011 foreign key (PARENT_ID) references MODE_SIMPLE_NODE create index QUERYID_INX on MODE_SUBGRAPH_NODES (QUERY_ID, UUID, DEPTH) alter table ModeShape_LARGEVALUE_USAGES add constraint FK4B54E5DAE58CEC5C foreign key (ID) references MODE_SIMPLE_NODE alter table ModeShape_LARGEVALUE_USAGES add constraint FK4B54E5DA1B6FBC1C foreign key (largeValues_SHA1) references MODE_SIMPLE_LARGE_VALUES create sequence hibernate_sequence During ModeShape startup the indices are not created, the log contains only 2010-10-22 12:27:55,676 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create table DNA_NAMESPACES (id int8 not null, URI varchar(512), primary key (id)) 2010-10-22 12:27:55,834 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create table DNA_WORKSPACES (id int8 not null, NAME varchar(128) not null, primary key (id)) 2010-10-22 12:27:55,884 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create table MODE_SIMPLE_LARGE_VALUES (SHA1 varchar(40) not null, COMPRESSED bool, DATA oid not null, LENGTH int8 not null, TYPE varchar(255) not null, primary key (SHA1)) 2010-10-22 12:27:55,933 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create table MODE_SIMPLE_NODE (ID int8 not null, ALLOWS_SNS bool not null, CHILD_NAME_LOCAL varchar(512), COMPRESSED bool, DATA oid, CHILD_INDEX int4 not null, NODE_UUID varchar(36) not null, NUM_PROPS int4 not null, ENFORCEREFINTEG bool not null, SNS_INDEX int4 not null, WORKSPACE_ID int8 not null, CHILD_NAME_NS_ID int8, PARENT_ID int8, primary key (ID)) 2010-10-22 12:27:56,008 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create table MODE_SUBGRAPH_NODES (ID int8 not null, DEPTH int4 not null, CHILD_NUM int4 not null, UUID varchar(36) not null, PARENT_NUM int4 not null, QUERY_ID int8 not null, primary key (ID)) 2010-10-22 12:27:56,057 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create table MODE_SUBGRAPH_QUERIES (ID int8 not null, ROOT_UUID varchar(36) not null, WORKSPACE_ID int8 not null, primary key (ID)) 2010-10-22 12:27:56,107 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create table ModeShape_LARGEVALUE_USAGES (ID int8 not null, largeValues_SHA1 varchar(40) not null) 2010-10-22 12:27:56,115 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) alter table MODE_SIMPLE_NODE add constraint FKE43E2BD346EF783F foreign key (CHILD_NAME_NS_ID) references DNA_NAMESPACES 2010-10-22 12:27:56,123 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) alter table MODE_SIMPLE_NODE add constraint FKE43E2BD360F39011 foreign key (PARENT_ID) references MODE_SIMPLE_NODE 2010-10-22 12:27:56,140 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) alter table ModeShape_LARGEVALUE_USAGES add constraint FK4B54E5DAE58CEC5C foreign key (ID) references MODE_SIMPLE_NODE 2010-10-22 12:27:56,148 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) alter table ModeShape_LARGEVALUE_USAGES add constraint FK4B54E5DA1B6FBC1C foreign key (largeValues_SHA1) references MODE_SIMPLE_LARGE_VALUES 2010-10-22 12:27:56,156 DEBUG [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) create sequence hibernate_sequence 2010-10-22 12:27:56,165 INFO [org.hibernate.tool.hbm2ddl.SchemaUpdate] (main) schema update complete And the database does not contain indices, see soaesb1=> \di List of relations Schema | Name | Type | Owner | Table --------+-------------------------------+-------+---------+-------------------------- public | dna_namespaces_pkey | index | soaesb1 | dna_namespaces public | dna_workspaces_pkey | index | soaesb1 | dna_workspaces public | mode_options_pkey | index | soaesb1 | mode_options public | mode_simple_large_values_pkey | index | soaesb1 | mode_simple_large_values public | mode_simple_node_pkey | index | soaesb1 | mode_simple_node public | mode_subgraph_nodes_pkey | index | soaesb1 | mode_subgraph_nodes public | mode_subgraph_queries_pkey | index | soaesb1 | mode_subgraph_queries (7 rows) Morevover why ModeShape_LARGEVALUE_USAGES does not contain primary key?
The issue is present only if parameter mode:autoGenerateSchema is set to update